From 9ea41412ad03d3c26e1b5f14fd8b115ea9381de7 Mon Sep 17 00:00:00 2001 From: fumiama Date: Fri, 6 Aug 2021 22:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=8C=96log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/golint.yml | 31 +++++++++++++++++++++++++++++++ .gitignore | 1 - go.mod | 2 +- go.sum | 4 ++++ main.go | 4 ++-- plugin_diana/data/text.go | 7 ++++--- 6 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/golint.yml diff --git a/.github/workflows/golint.yml b/.github/workflows/golint.yml new file mode 100644 index 00000000..c07742d4 --- /dev/null +++ b/.github/workflows/golint.yml @@ -0,0 +1,31 @@ +name: PushLint +on: [push] +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: latest + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true then the action will use pre-installed Go. + # skip-go-installation: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true diff --git a/.gitignore b/.gitignore index e063b380..9842d743 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ data/manager .idea/ .DS_Store .vscode -.github/workflows/golint.yml diff --git a/go.mod b/go.mod index 405ee98b..7491df34 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/FloatTech/AnimeAPI v0.0.0-20210713044920-63367fe18ccd github.com/FloatTech/ZeroBot-ACGImage v1.5.5 - github.com/FloatTech/ZeroBot-Plugin-Timer v1.3.4 + github.com/FloatTech/ZeroBot-Plugin-Timer v1.4.2 github.com/StackExchange/wmi v1.2.1 // indirect github.com/golang/protobuf v1.5.2 github.com/robfig/cron v1.2.0 diff --git a/go.sum b/go.sum index c1ac735d..eb9a8334 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,10 @@ github.com/FloatTech/ZeroBot-ACGImage v1.5.5 h1:cmAsXHl99RHJR38vQXL+q/U0BGWg5LyM github.com/FloatTech/ZeroBot-ACGImage v1.5.5/go.mod h1:TDGCgGHKjgcnA0akLaEwUcFwL+/ya7p6PZITdJQ1vnQ= github.com/FloatTech/ZeroBot-Plugin-Timer v1.3.4 h1:nRJqY/S7TRlN32MQGIBH3UWfVrpjxpJXCnp42pd2O2Q= github.com/FloatTech/ZeroBot-Plugin-Timer v1.3.4/go.mod h1:NuODdnVhf9AClsJBdYFqnL9sQE7VIRZyZos37J286n0= +github.com/FloatTech/ZeroBot-Plugin-Timer v1.4.1 h1:LVSTyfLlhcJEES16r3gyhN2jd2WJUlQiN193f0DdJ7Q= +github.com/FloatTech/ZeroBot-Plugin-Timer v1.4.1/go.mod h1:NuODdnVhf9AClsJBdYFqnL9sQE7VIRZyZos37J286n0= +github.com/FloatTech/ZeroBot-Plugin-Timer v1.4.2 h1:w/JerL8DwdyoxZYB4HRMaHANRV2j+r5XxaQhVB0sjBw= +github.com/FloatTech/ZeroBot-Plugin-Timer v1.4.2/go.mod h1:MVOQQ4e6AVGFm993blXXU4Sd6bAsLY2+Zb+/HMrEeEc= github.com/FloatTech/Zerobot-ACGImage-Classify v1.3.3 h1:mMaBe23yg8mk5U0yb9OS9iX/9hju6Dj+Z+Fty18vIhU= github.com/FloatTech/Zerobot-ACGImage-Classify v1.3.3/go.mod h1:swPvVKyXu1YFWZ7Kt6R79LgIa16hs4cE1E5LroBB2SQ= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= diff --git a/main.go b/main.go index 38bb2959..1855ce86 100644 --- a/main.go +++ b/main.go @@ -59,9 +59,9 @@ func init() { func main() { fmt.Print( - "====================[ZeroBot-Plugin]====================", + "======================[ZeroBot-Plugin]======================", "\n", strings.Join(content, "\n"), "\n", - "========================================================", + "============================================================\n", ) // 启动打印 zero.Run(zero.Config{ NickName: []string{"椛椛", "ATRI", "atri", "亚托莉", "アトリ"}, diff --git a/plugin_diana/data/text.go b/plugin_diana/data/text.go index b1b17137..10a87e26 100644 --- a/plugin_diana/data/text.go +++ b/plugin_diana/data/text.go @@ -2,10 +2,11 @@ package data import ( - "fmt" "io" "os" "time" + + log "github.com/sirupsen/logrus" ) const ( @@ -28,9 +29,9 @@ func init() { } err1 := LoadText() if err1 == nil { - fmt.Printf("[Diana]读取%d条小作文\n", len(*Array)) + log.Printf("[Diana]读取%d条小作文", len(*Array)) } else { - fmt.Printf("[Diana]读取小作文错误:%v\n", err1) + log.Printf("[Diana]读取小作文错误:%v", err1) } }() }