mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor(cli): avoid importing coderd in slim server (#9483)
This small change removes 11 MB from the slim binary size. Ref: #9380
This commit is contained in:
+1
-5
@@ -35,7 +35,6 @@ import (
|
||||
"github.com/coder/coder/v2/cli/clibase"
|
||||
"github.com/coder/coder/v2/cli/cliui"
|
||||
"github.com/coder/coder/v2/cli/config"
|
||||
"github.com/coder/coder/v2/coderd"
|
||||
"github.com/coder/coder/v2/coderd/gitauth"
|
||||
"github.com/coder/coder/v2/coderd/telemetry"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
@@ -119,10 +118,7 @@ func (r *RootCmd) Core() []*clibase.Cmd {
|
||||
}
|
||||
|
||||
func (r *RootCmd) AGPL() []*clibase.Cmd {
|
||||
all := append(r.Core(), r.Server(func(_ context.Context, o *coderd.Options) (*coderd.API, io.Closer, error) {
|
||||
api := coderd.New(o)
|
||||
return api, api, nil
|
||||
}))
|
||||
all := append(r.Core(), r.Server( /* Do not import coderd here. */ nil))
|
||||
return all
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user