Skip to content

Commit

Permalink
Make golangci-lint.yml ok
Browse files Browse the repository at this point in the history
  • Loading branch information
mudream4869 committed Oct 19, 2024
1 parent e429a11 commit a2e64ca
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Fake build assets
run: |
cd toolgui-web
mkdir -p app/build/static
echo "fake" > app/build/index.html
echo "fake" > app/build/static/fake.txt
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
Expand Down
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
issues:
exclude-dirs:
- toolgui-web

linters-settings:
errcheck:
exclude-functions:
- (golang.org/x/net/websocket.Codec).Send
- (golang.org/x/net/websocket.Codec).Receive
- (net/http.ResponseWriter).Write
5 changes: 4 additions & 1 deletion cmd/toolgui-demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,5 +570,8 @@ func main() {

e := tgexec.NewWebExecutor(app)
log.Println("Starting service...")
e.StartService(":3000")
err := e.StartService(":3000")
if err != nil {
log.Println(err)
}
}
5 changes: 4 additions & 1 deletion cmd/toolgui-todo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@ func main() {

e := tgexec.NewWebExecutor(app)
log.Println("Starting service...")
e.StartService(":3000")
err := e.StartService(":3000")
if err != nil {
log.Println(err)
}
}
Empty file added toolgui-web/app/build/.gitkeep
Empty file.
3 changes: 2 additions & 1 deletion toolgui/tgutil/errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tgutil

import (
"errors"
"fmt"
"runtime"
)
Expand All @@ -22,5 +23,5 @@ func NewError(info string) error {
if ok {
prefix = fmt.Sprintf("%s: ", runtime.FuncForPC(pc).Name())
}
return fmt.Errorf(prefix + info)
return errors.New(prefix + info)
}

0 comments on commit a2e64ca

Please sign in to comment.