mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update golang to 1.24.1 (#17035)
- Update go.mod to use Go 1.24.1 - Update GitHub Actions setup-go action to use Go 1.24.1 - Fix linting issues with golangci-lint by: - Updating to golangci-lint v1.57.1 (more compatible with Go 1.24.1) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <claude@anthropic.com>
This commit is contained in:
@@ -116,7 +116,7 @@ func TypeMappings(gen *guts.GoParser) error {
|
||||
// 'serpent.Struct' overrides the json.Marshal to use the underlying type,
|
||||
// so the typescript type should be the underlying type.
|
||||
func FixSerpentStruct(gen *guts.Typescript) {
|
||||
gen.ForEach(func(key string, originalNode bindings.Node) {
|
||||
gen.ForEach(func(_ string, originalNode bindings.Node) {
|
||||
isInterface, ok := originalNode.(*bindings.Interface)
|
||||
if ok && isInterface.Name.Ref() == "SerpentStruct" {
|
||||
// replace it with
|
||||
|
||||
@@ -54,10 +54,8 @@ func init() {
|
||||
"wrapCode": func(s string) string {
|
||||
return fmt.Sprintf("<code>%s</code>", s)
|
||||
},
|
||||
"commandURI": func(cmd *serpent.Command) string {
|
||||
return fmtDocFilename(cmd)
|
||||
},
|
||||
"fullName": fullName,
|
||||
"commandURI": fmtDocFilename,
|
||||
"fullName": fullName,
|
||||
"tableHeader": func() string {
|
||||
return `| | |
|
||||
| --- | --- |`
|
||||
|
||||
@@ -53,7 +53,7 @@ func run() error {
|
||||
}
|
||||
databasePath := filepath.Join(localPath, "..", "..", "..", "coderd", "database")
|
||||
|
||||
err = orderAndStubDatabaseFunctions(filepath.Join(databasePath, "dbmem", "dbmem.go"), "q", "FakeQuerier", func(params stubParams) string {
|
||||
err = orderAndStubDatabaseFunctions(filepath.Join(databasePath, "dbmem", "dbmem.go"), "q", "FakeQuerier", func(_ stubParams) string {
|
||||
return `panic("not implemented")`
|
||||
})
|
||||
if err != nil {
|
||||
@@ -72,7 +72,7 @@ return %s
|
||||
return xerrors.Errorf("stub dbmetrics: %w", err)
|
||||
}
|
||||
|
||||
err = orderAndStubDatabaseFunctions(filepath.Join(databasePath, "dbauthz", "dbauthz.go"), "q", "querier", func(params stubParams) string {
|
||||
err = orderAndStubDatabaseFunctions(filepath.Join(databasePath, "dbauthz", "dbauthz.go"), "q", "querier", func(_ stubParams) string {
|
||||
return `panic("not implemented")`
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -20,19 +20,19 @@ func main() {
|
||||
defer l.Close()
|
||||
tcpAddr, valid := l.Addr().(*net.TCPAddr)
|
||||
if !valid {
|
||||
log.Fatal("address is not valid")
|
||||
log.Panic("address is not valid")
|
||||
}
|
||||
|
||||
remotePort := tcpAddr.Port
|
||||
_, err = fmt.Println(remotePort)
|
||||
if err != nil {
|
||||
log.Fatalf("print error: err=%s", err)
|
||||
log.Panicf("print error: err=%s", err)
|
||||
}
|
||||
|
||||
for {
|
||||
conn, err := l.Accept()
|
||||
if err != nil {
|
||||
log.Fatalf("accept error, err=%s", err)
|
||||
log.Panicf("accept error, err=%s", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func main() {
|
||||
if errors.Is(err, io.EOF) {
|
||||
return
|
||||
} else if err != nil {
|
||||
log.Fatalf("copy error, err=%s", err)
|
||||
log.Panicf("copy error, err=%s", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -82,25 +82,25 @@ func main() {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "Init database at version %q\n", migrateFromVersion)
|
||||
if err := migrations.UpWithFS(conn, migrateFromFS); err != nil {
|
||||
friendlyError(os.Stderr, err, migrateFromVersion, migrateToVersion)
|
||||
os.Exit(1)
|
||||
panic("")
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintf(os.Stderr, "Migrate to version %q\n", migrateToVersion)
|
||||
if err := migrations.UpWithFS(conn, migrateToFS); err != nil {
|
||||
friendlyError(os.Stderr, err, migrateFromVersion, migrateToVersion)
|
||||
os.Exit(1)
|
||||
panic("")
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintf(os.Stderr, "Dump schema at version %q\n", migrateToVersion)
|
||||
dumpBytesAfter, err := dbtestutil.PGDumpSchemaOnly(postgresURL)
|
||||
if err != nil {
|
||||
friendlyError(os.Stderr, err, migrateFromVersion, migrateToVersion)
|
||||
os.Exit(1)
|
||||
panic("")
|
||||
}
|
||||
|
||||
if diff := cmp.Diff(string(dumpBytesAfter), string(stripGenPreamble(expectedSchemaAfter))); diff != "" {
|
||||
friendlyError(os.Stderr, xerrors.Errorf("Schema differs from expected after migration: %s", diff), migrateFromVersion, migrateToVersion)
|
||||
os.Exit(1)
|
||||
panic("")
|
||||
}
|
||||
_, _ = fmt.Fprintf(os.Stderr, "OK\n")
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ func main() {
|
||||
|
||||
err = cmd.Invoke().WithOS().Run()
|
||||
if err != nil {
|
||||
if errors.Is(err, cliui.Canceled) {
|
||||
if errors.Is(err, cliui.ErrCanceled) {
|
||||
os.Exit(1)
|
||||
}
|
||||
r.logger.Error(context.Background(), "release command failed", "err", err)
|
||||
|
||||
@@ -38,7 +38,7 @@ func main() {
|
||||
flag.Parse()
|
||||
|
||||
// This is just a way to run tests outside go test
|
||||
testing.Main(func(pat, str string) (bool, error) {
|
||||
testing.Main(func(_, _ string) (bool, error) {
|
||||
return true, nil
|
||||
}, []testing.InternalTest{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user