Skip to content

Commit

Permalink
chore: deps up and perfect code style
Browse files Browse the repository at this point in the history
  • Loading branch information
yzy613 committed Oct 19, 2024
1 parent 5d61141 commit 654f747
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: make -f Makefile.server

- name: Upload release binaries
uses: alexellis/[email protected].0
uses: alexellis/[email protected].1
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
.idea
build
test
.buildpath
.hgignore.swp
.project
.orig
.swp
.idea/
.settings/
.vscode/
bin/
**/.DS_Store
build/
test/
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module ddns-watchdog
go 1.23

require (
github.com/aliyun/alibaba-cloud-sdk-go v1.63.27
github.com/aliyun/alibaba-cloud-sdk-go v1.63.32
github.com/bitly/go-simplejson v0.5.1
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.117
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.118
github.com/spf13/pflag v1.0.5
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/aliyun/alibaba-cloud-sdk-go v1.63.27 h1:mDQ6eofwppTbmvlh8q3+76Oq3fAeN+TwpD/csiki5VE=
github.com/aliyun/alibaba-cloud-sdk-go v1.63.27/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ=
github.com/aliyun/alibaba-cloud-sdk-go v1.63.32 h1:aBtZr6N7HXVpJCMybTSBuinHauehf/R0LNMB03TkrE0=
github.com/aliyun/alibaba-cloud-sdk-go v1.63.32/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ=
github.com/bitly/go-simplejson v0.5.1 h1:xgwPbetQScXt1gh9BmoJ6j9JMr3TElvuIyjR8pgdoow=
github.com/bitly/go-simplejson v0.5.1/go.mod h1:YOPVLzCfwK14b4Sff3oP1AmGhI9T9Vsg84etUnlyp+Q=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down Expand Up @@ -43,8 +43,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.117 h1:TUiy5+4+Q7AWNfvKjQQL6lXOylnp7HL47JyYJ+HgN+I=
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.117/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI=
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.118 h1:YHcixaT7Le4PxuxN07KQ5j9nPeH4ZdyXtMTSgA+Whh8=
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.118/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
Expand Down
6 changes: 2 additions & 4 deletions internal/server/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func GenerateToken(length int) (token string) {
}
b[i] = letter[bigNum.Int64()]
}
token = string(b)
return
return string(b)
}

func DelFromWhitelist(token string) (msg string, err error) {
Expand Down Expand Up @@ -145,8 +144,7 @@ func InitWhitelist() (msg string, err error) {
if err = common.MarshalAndSave(whitelist, ConfDirectoryName+"/"+WhitelistFileName); err != nil {
return
}
msg = "初始化 " + ConfDirectoryName + "/" + WhitelistFileName
return
return "初始化 " + ConfDirectoryName + "/" + WhitelistFileName, nil
}

func LoadWhitelist() (err error) {
Expand Down
3 changes: 1 addition & 2 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ func (conf *server) InitConf() (msg string, err error) {
if err = common.MarshalAndSave(conf, ConfDirectoryName+"/"+ConfFileName); err != nil {
return
}
msg = "初始化 " + ConfDirectoryName + "/" + ConfFileName
return
return "初始化 " + ConfDirectoryName + "/" + ConfFileName, nil
}

func (conf *server) LoadConf() (err error) {
Expand Down
6 changes: 2 additions & 4 deletions internal/server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ func (conf *service) InitConf() (msg string, err error) {
if err = common.MarshalAndSave(conf, ConfDirectoryName+"/"+ServiceConfFileName); err != nil {
return
}
msg = "初始化 " + ConfDirectoryName + "/" + ServiceConfFileName
return
return "初始化 " + ConfDirectoryName + "/" + ServiceConfFileName, nil
}

func (conf *service) LoadConf() (err error) {
if err = common.LoadAndUnmarshal(ConfDirectoryName+"/"+ServiceConfFileName, &conf); err != nil {
return
}
err = LoadWhitelist()
return
return LoadWhitelist()
}

0 comments on commit 654f747

Please sign in to comment.