Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for go modules. #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion configmap/testdata/..data

This file was deleted.

9 changes: 9 additions & 0 deletions configmap/updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package configmap_test

import (
"path/filepath"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -67,6 +69,13 @@ func (s *updaterTestSuite) TearDownTest() {
func (s *updaterTestSuite) copyTestDataToDir() {
copyCmd := exec.Command("cp", "--archive", "testdata", s.tempDir)
require.NoError(s.T(), copyCmd.Run(), "copying testdata directory to tempdir must not fail")
// We are storing file testdata/9989_09_09_07_32_32.099817316 and renaming it to testdata/..9989_09_09_07_32_32.099817316,
// because go modules don't allow repos with files with .. in their filename. See https://github.com/golang/go/issues/27299.
for _, p := range []string{firstGoodDir, secondGoodDir, badStaticDir} {
pOld := filepath.Join(s.tempDir, "testdata", strings.TrimPrefix(p, ".."))
pNew := filepath.Join(s.tempDir, "testdata", p)
require.NoError(s.T(), os.Rename(pOld, pNew), "renaming %q to %q failed", pOld, pNew)
}
}

func (s *updaterTestSuite) linkDataDirTo(newDataDir string) {
Expand Down
14 changes: 14 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module github.com/mwitkow/go-flagz

require (
github.com/coreos/etcd v3.3.12+incompatible
github.com/coreos/go-semver v0.3.0 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/golang/protobuf v1.3.1
github.com/prometheus/client_golang v0.9.2
github.com/spf13/pflag v1.0.3
github.com/stretchr/testify v1.3.0
github.com/ugorji/go v1.1.4 // indirect
golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6
golang.org/x/sys v0.0.0-20190425145619-16072639606e // indirect
)