Skip to content

Commit 4faded1

Browse files
committed
chore: quick update feat/supervisor at 2025-09-13 21:05:06
1 parent 111191a commit 4faded1

File tree

47 files changed

+304
-365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+304
-365
lines changed

.golangci.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,38 @@ version: "2"
22
linters:
33
default: none
44
enable:
5+
- errcheck
56
- govet
7+
- staticcheck
68
exclusions:
79
presets:
810
- comments
911
- common-false-positives
1012
- legacy
1113
- std-error-handling
14+
rules:
15+
- linters:
16+
- dupl
17+
- errcheck
18+
- gocyclo
19+
- gosec
20+
path: _test\.go
21+
- linters:
22+
- forbidigo
23+
path-except: _test\.go
1224
paths:
13-
- vendor
25+
- .*_test\.go$
26+
- examples/
1427
- third_party$
1528
- builtin$
1629
- examples$
1730
formatters:
31+
enable:
32+
- goimports
1833
exclusions:
1934
paths:
35+
- .*_test\.go$
36+
- examples/
2037
- third_party$
2138
- builtin$
2239
- examples$

.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v2.0.0

clients/grpcc/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func New(cfg *grpccconfig.Cfg, p Params, middlewares ...lava.Middleware) Client
3535
middlewares: middlewares,
3636
}
3737

38-
vars.RegisterValue(fmt.Sprintf("%s-grpc-client-config", cfg.Service.Name), cfg)
38+
vars.Register(fmt.Sprintf("%s-grpc-client-config", cfg.Service.Name), func() any { return cfg })
3939
return c
4040
}
4141

clients/grpcc/middleware.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ func md2Head(md metadata.MD, header interface{ Add(key, value string) }) {
2929
}
3030

3131
func head2md(header *lava.RequestHeader, md metadata.MD) {
32-
header.VisitAll(func(key, value []byte) {
32+
for key, value := range header.All() {
3333
md.Append(convert.BtoS(key), convert.BtoS(value))
34-
})
34+
}
3535
}
3636

3737
func unaryInterceptor(middlewares []lava.Middleware) grpc.UnaryClientInterceptor {

clients/resty/jar.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ func (j *Jar) Middleware(next lava.HandlerFunc) lava.HandlerFunc {
4141
return nil, err
4242
}
4343

44-
rsp.Header().VisitAllCookie(func(key, value []byte) {
44+
for _, value := range rsp.Header().All() {
4545
acquireCookie := fasthttp.AcquireCookie()
4646
if err := acquireCookie.ParseBytes(value); err != nil {
4747
j.log.Err(err, ctx).Msg("failed to parse cookie")
4848
} else {
4949
j.cookies[string(acquireCookie.Key())] = acquireCookie
5050
}
51-
})
51+
}
5252

5353
return rsp, err
5454
}

cmds/depcmd/cmd.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/olekukonko/tablewriter"
1010
"github.com/pubgo/dix"
11+
"github.com/pubgo/funk/assert"
1112
"github.com/pubgo/funk/pretty"
1213
"github.com/pubgo/funk/recovery"
1314
"github.com/pubgo/funk/running"
@@ -46,12 +47,12 @@ func New(di *dix.Dix) *cli.Command {
4647
case "table", "tb", "t":
4748
table := tablewriter.NewWriter(os.Stdout)
4849
table.Header([]string{"path", "Version", "Replace"})
49-
table.Append([]string{info.Main.Path, version.Version(), replace(info.Main.Replace)})
50+
assert.Must(table.Append([]string{info.Main.Path, version.Version(), replace(info.Main.Replace)}))
5051

5152
for _, dep := range info.Deps {
52-
table.Append([]string{dep.Path, dep.Version, replace(dep.Replace)})
53+
assert.Must(table.Append([]string{dep.Path, dep.Version, replace(dep.Replace)}))
5354
}
54-
table.Render()
55+
assert.Must(table.Render())
5556
case "di":
5657
fmt.Println(di.Graph().Objects)
5758
fmt.Println(di.Graph().Providers)

cmds/grpcservercmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func New(di *dix.Dix) *cli.Command {
3030
assert.Exit(manager.Add(svc))
3131
}
3232

33-
return manager.Run()
33+
return manager.Run(ctx)
3434
},
3535
}
3636
}

cmds/httpservercmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func New(di *dix.Dix) *cli.Command {
3030
assert.Exit(manager.Add(svc))
3131
}
3232

33-
return manager.Run()
33+
return manager.Run(ctx)
3434
},
3535
}
3636
}

cmds/schedulercmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func New(di *dix.Dix) *cli.Command {
3737
assert.Exit(manager.Add(svc))
3838
}
3939

40-
return manager.Run()
40+
return manager.Run(ctx)
4141
},
4242
}
4343
}

cmds/servecmd/cmd.go

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)