aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-03-16 17:40:06 +0700
committerShulhan <ms@kilabit.info>2024-03-16 17:40:06 +0700
commite8e3cb778a2238fe915d05b690b9dbeb2c4e2a8a (patch)
treeb27ba3cac3899e2d2fe6ec2fa70eb92e85e8e9a8
parent1e7d8e360eac2c815ac7b79ddf5ec11253833f95 (diff)
downloadhaminer-e8e3cb778a2238fe915d05b690b9dbeb2c4e2a8a.tar.xz
all: replace module "share" with "pakakeh.go"
-rw-r--r--config.go2
-rw-r--r--config_test.go16
-rw-r--r--go.mod6
-rw-r--r--go.sum8
-rw-r--r--questdb_client.go2
-rw-r--r--tagpreprocessor_test.go2
-rw-r--r--testdata/.gitignore1
7 files changed, 23 insertions, 14 deletions
diff --git a/config.go b/config.go
index 5f0d89e..2c8af49 100644
--- a/config.go
+++ b/config.go
@@ -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
}
diff --git a/go.mod b/go.mod
index 049cdff..c359df6 100644
--- a/go.mod
+++ b/go.mod
@@ -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
diff --git a/go.sum b/go.sum
index 5e36ed9..9edb8c8 100644
--- a/go.sum
+++ b/go.sum
@@ -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