Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1734dfd

Browse files
authored
chore: cleanup unused Client in server command (#19762)
As part of converting production code to use the new ClientBuilder, I noticed some dead code that creates a client with a URL for the only purpose of later accessing the URL. This PR removes the cruft.
1 parent1d0e79f commit1734dfd

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

‎cli/server.go‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -974,23 +974,10 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
974974
}
975975
}
976976

977-
client:=codersdk.New(localURL)
978-
iflocalURL.Scheme=="https"&&IsLocalhost(localURL.Hostname()) {
979-
// The certificate will likely be self-signed or for a different
980-
// hostname, so we need to skip verification.
981-
client.HTTPClient.Transport=&http.Transport{
982-
TLSClientConfig:&tls.Config{
983-
//nolint:gosec
984-
InsecureSkipVerify:true,
985-
},
986-
}
987-
}
988-
deferclient.HTTPClient.CloseIdleConnections()
989-
990977
// This is helpful for tests, but can be silently ignored.
991978
// Coder may be ran as users that don't have permission to write in the homedir,
992979
// such as via the systemd service.
993-
err=config.URL().Write(client.URL.String())
980+
err=config.URL().Write(localURL.String())
994981
iferr!=nil&&flag.Lookup("test.v")!=nil {
995982
returnxerrors.Errorf("write config url: %w",err)
996983
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp