Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbuddy committed Mar 22, 2024
1 parent 2d5a0f3 commit 598e97c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
8 changes: 0 additions & 8 deletions cmd/bz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"runtime/debug"
"strconv"
"strings"
"sync"
"time"

"github.com/bmatcuk/doublestar/v4"
Expand All @@ -46,7 +45,6 @@ var (
)

const noInstallOption = "I'll do it myself"
const debounceDurationMS = 500

func validateName(name string) error {
if len(strings.TrimSpace(name)) == 0 {
Expand Down Expand Up @@ -100,12 +98,6 @@ func main() {
}
}

type notifier struct {
out func()
notified bool
lock sync.Mutex
}

type userGameVersion struct {
ID uint64 `json:"id"`
Name string `json:"name"`
Expand Down
2 changes: 1 addition & 1 deletion internal/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (b *Builder) Build(mode BuildMode, types BuildType) ([]byte, []byte, error)

results := make(chan result, len(buildSteps))
ctx, cancelFn := context.WithCancel(context.Background())
defer cancelFn()
for c := range buildSteps {
go func(c cmd) {
results <- b.run(ctx, c.root, c.cmd)
Expand All @@ -94,7 +95,6 @@ func (b *Builder) Build(mode BuildMode, types BuildType) ([]byte, []byte, error)
for range buildSteps {
res = <-results
if res.err != nil {
cancelFn()
return res.stdout, res.stderr, res.err
}
}
Expand Down
5 changes: 4 additions & 1 deletion internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,10 @@ func (s *Server) reprocessHistory(req *ReprocessRequest) (*ReprocessResponse, er
return nil
})
global := v8go.NewObjectTemplate(iso)
global.Set("log", log)
if err := global.Set("log", log); err != nil {
errs <- fmt.Errorf("error setting log: %w", err)
return
}
ctx := v8go.NewContext(iso, global)
if _, err := ctx.RunScript("console.log = log; console.error = log;", "load.js"); err != nil {
errs <- fmt.Errorf("error loading game: %w", err)
Expand Down

0 comments on commit 598e97c

Please sign in to comment.