diff options
| -rw-r--r-- | config.go | 2 | ||||
| -rw-r--r-- | config_test.go | 16 | ||||
| -rw-r--r-- | go.mod | 6 | ||||
| -rw-r--r-- | go.sum | 8 | ||||
| -rw-r--r-- | questdb_client.go | 2 | ||||
| -rw-r--r-- | tagpreprocessor_test.go | 2 | ||||
| -rw-r--r-- | testdata/.gitignore | 1 |
7 files changed, 23 insertions, 14 deletions
@@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/shuLhan/share/lib/ini" + "git.sr.ht/~shulhan/pakakeh.go/lib/ini" ) // List of default config key values. diff --git a/config_test.go b/config_test.go index d2c4601..f259dbf 100644 --- a/config_test.go +++ b/config_test.go @@ -4,11 +4,12 @@ package haminer import ( + "os" "regexp" "testing" "time" - "github.com/shuLhan/share/lib/test" + "git.sr.ht/~shulhan/pakakeh.go/lib/test" ) func TestNewConfig(t *testing.T) { @@ -41,6 +42,8 @@ func TestLoad(t *testing.T) { expError string } + _ = os.Remove(`testdata/notexist.conf`) + var cases = []testCase{{ desc: "With empty path", exp: &Config{ @@ -49,9 +52,13 @@ func TestLoad(t *testing.T) { ForwardInterval: defForwardInterval, }, }, { - desc: `With path not exist`, - in: `testdata/notexist.conf`, - expError: `Load: open testdata/notexist.conf: no such file or directory`, + desc: `With path not exist`, + in: `testdata/notexist.conf`, + exp: &Config{ + listenAddr: defListenAddr, + listenPort: defListenPort, + ForwardInterval: defForwardInterval, + }, }, { desc: "With path exist", in: "testdata/haminer.conf", @@ -111,6 +118,7 @@ func TestLoad(t *testing.T) { got = NewConfig() err = got.Load(c.in) if err != nil { + t.Logf(`err=%s`, err) test.Assert(t, `error`, c.expError, err.Error()) continue } @@ -1,7 +1,7 @@ module git.sr.ht/~shulhan/haminer -go 1.18 +go 1.21 -require github.com/shuLhan/share v0.44.0 +require git.sr.ht/~shulhan/pakakeh.go v0.53.2-0.20240315075343-713d51e4792f -require golang.org/x/sys v0.6.0 // indirect +require golang.org/x/sys v0.18.0 // indirect @@ -1,4 +1,4 @@ -github.com/shuLhan/share v0.44.0 h1:Afom8pQrzNYtUZM53y+eqlZw5lkFm7bgl3QjZ3ARsgg= -github.com/shuLhan/share v0.44.0/go.mod h1:BnjohSsgDFMeYQ0/ws7kzb1oABZdVbEwDNGbUhOLee4= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +git.sr.ht/~shulhan/pakakeh.go v0.53.2-0.20240315075343-713d51e4792f h1:bP4msj5TVm+kQ6GUt6QvwEXOVOzUk2MQc5c8bSto8sc= +git.sr.ht/~shulhan/pakakeh.go v0.53.2-0.20240315075343-713d51e4792f/go.mod h1:tTHoHDHuBxj5q1zwpLZGCKrdc6i0I3sP8kPp+JEs16c= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/questdb_client.go b/questdb_client.go index 7a62e4d..55c99eb 100644 --- a/questdb_client.go +++ b/questdb_client.go @@ -11,7 +11,7 @@ import ( "net/url" "time" - libnet "github.com/shuLhan/share/lib/net" + libnet "git.sr.ht/~shulhan/pakakeh.go/lib/net" ) const ( diff --git a/tagpreprocessor_test.go b/tagpreprocessor_test.go index 4ce6806..6e5ff2b 100644 --- a/tagpreprocessor_test.go +++ b/tagpreprocessor_test.go @@ -7,7 +7,7 @@ import ( "regexp" "testing" - "github.com/shuLhan/share/lib/test" + "git.sr.ht/~shulhan/pakakeh.go/lib/test" ) func TestNewTagPreprocessor(t *testing.T) { diff --git a/testdata/.gitignore b/testdata/.gitignore new file mode 100644 index 0000000..bf50733 --- /dev/null +++ b/testdata/.gitignore @@ -0,0 +1 @@ +/notexist.conf |
