chore: format Go more aggressively

This commit is contained in:
Ammar Bandukwala
2023-02-18 18:32:09 -06:00
committed by GitHub
parent 19ae411f05
commit f05609b4da
97 changed files with 411 additions and 413 deletions

View File

@ -976,9 +976,7 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
// parseURL parses a string into a URL.
func parseURL(u string) (*url.URL, error) {
var (
hasScheme = strings.HasPrefix(u, "http:") || strings.HasPrefix(u, "https:")
)
hasScheme := strings.HasPrefix(u, "http:") || strings.HasPrefix(u, "https:")
if !hasScheme {
return nil, xerrors.Errorf("URL %q must have a scheme of either http or https", u)
@ -1529,7 +1527,7 @@ func buildLogger(cmd *cobra.Command, cfg *codersdk.DeploymentConfig) (slog.Logge
sinks = append(sinks, sinkFn(cmd.ErrOrStderr()))
default:
fi, err := os.OpenFile(loc, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
fi, err := os.OpenFile(loc, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644)
if err != nil {
return xerrors.Errorf("open log file %q: %w", loc, err)
}