diff --git a/Dockerfile b/Dockerfile index d896bd06..686fde14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.25.5 AS build +FROM golang:1.26.0 AS build WORKDIR /app COPY . . diff --git a/docker-compose.yml b/docker-compose.yml index 881a93db..b117f940 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '2' services: app: - image: golang:1.25.5 + image: golang:1.26.0 volumes: - .:/work working_dir: /work diff --git a/go.mod b/go.mod index ec1a8aaf..30e42a9d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/planetscale/cli -go 1.25.5 +go 1.26.0 require ( github.com/99designs/keyring v1.2.2 diff --git a/internal/cmd/backup/delete.go b/internal/cmd/backup/delete.go index 6589bddd..8c1d4809 100644 --- a/internal/cmd/backup/delete.go +++ b/internal/cmd/backup/delete.go @@ -36,7 +36,7 @@ func DeleteCmd(ch *cmdutil.Helper) *cobra.Command { if !force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot delete backup with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot delete backup with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } confirmationName := fmt.Sprintf("%s/%s/%s", database, branch, backup) diff --git a/internal/cmd/branch/delete.go b/internal/cmd/branch/delete.go index ba2bcdb5..4822f967 100644 --- a/internal/cmd/branch/delete.go +++ b/internal/cmd/branch/delete.go @@ -50,7 +50,7 @@ func DeleteCmd(ch *cmdutil.Helper) *cobra.Command { if !force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot delete branch with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot delete branch with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } if db.Kind == "mysql" { diff --git a/internal/cmd/database/delete.go b/internal/cmd/database/delete.go index 3b435a11..20f0d3bd 100644 --- a/internal/cmd/database/delete.go +++ b/internal/cmd/database/delete.go @@ -36,7 +36,7 @@ func DeleteCmd(ch *cmdutil.Helper) *cobra.Command { if !force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot delete database with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot delete database with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } if !printer.IsTTY { diff --git a/internal/cmd/password/delete.go b/internal/cmd/password/delete.go index d239c7d4..e7fce5c7 100644 --- a/internal/cmd/password/delete.go +++ b/internal/cmd/password/delete.go @@ -102,7 +102,7 @@ func DeleteCmd(ch *cmdutil.Helper) *cobra.Command { if !force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot delete password with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot delete password with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } var confirmationName string diff --git a/internal/cmd/role/delete.go b/internal/cmd/role/delete.go index 3b65ed3a..f5eeba57 100644 --- a/internal/cmd/role/delete.go +++ b/internal/cmd/role/delete.go @@ -38,7 +38,7 @@ func DeleteCmd(ch *cmdutil.Helper) *cobra.Command { if !flags.force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot delete role with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot delete role with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } confirmationName := fmt.Sprintf("%s/%s/%s", database, branch, roleID) diff --git a/internal/cmd/role/reassign.go b/internal/cmd/role/reassign.go index f1a8888c..34e0b85c 100644 --- a/internal/cmd/role/reassign.go +++ b/internal/cmd/role/reassign.go @@ -41,7 +41,7 @@ func ReassignCmd(ch *cmdutil.Helper) *cobra.Command { if !flags.force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot reassign role objects with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot reassign role objects with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } confirmationName := fmt.Sprintf("%s/%s/%s", database, branch, roleID) diff --git a/internal/cmd/role/reset.go b/internal/cmd/role/reset.go index 1fb3d670..5cf7c639 100644 --- a/internal/cmd/role/reset.go +++ b/internal/cmd/role/reset.go @@ -36,7 +36,7 @@ func ResetCmd(ch *cmdutil.Helper) *cobra.Command { if !flags.force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot reset role password with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot reset role password with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } confirmationName := fmt.Sprintf("%s/%s/%s", database, branch, roleID) diff --git a/internal/cmd/role/reset_default.go b/internal/cmd/role/reset_default.go index f02afe77..ed727597 100644 --- a/internal/cmd/role/reset_default.go +++ b/internal/cmd/role/reset_default.go @@ -37,7 +37,7 @@ func ResetDefaultCmd(ch *cmdutil.Helper) *cobra.Command { if !flags.force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot delete password with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot delete password with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } confirmationName := fmt.Sprintf("%s/%s", database, branch) diff --git a/internal/cmd/workflow/cancel.go b/internal/cmd/workflow/cancel.go index bfd81633..b91ebf52 100644 --- a/internal/cmd/workflow/cancel.go +++ b/internal/cmd/workflow/cancel.go @@ -40,7 +40,7 @@ marks it as cancelled, allowing you to start a new workflow if needed.`, if !force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot cancel workflow with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot cancel workflow with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } if !printer.IsTTY { diff --git a/internal/cmd/workflow/cutover.go b/internal/cmd/workflow/cutover.go index c0e1f11b..5609030f 100644 --- a/internal/cmd/workflow/cutover.go +++ b/internal/cmd/workflow/cutover.go @@ -39,7 +39,7 @@ func CutoverCmd(ch *cmdutil.Helper) *cobra.Command { if !force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot cutover with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot cutover with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } if !printer.IsTTY { diff --git a/internal/cmd/workflow/switch_traffic.go b/internal/cmd/workflow/switch_traffic.go index df53ddd9..69301afb 100644 --- a/internal/cmd/workflow/switch_traffic.go +++ b/internal/cmd/workflow/switch_traffic.go @@ -44,7 +44,7 @@ By default, this command will route all queries for primary, replica, and read-o if !force { if ch.Printer.Format() != printer.Human { - return fmt.Errorf("cannot switch query traffic with the output format %q (run with --force to override)", ch.Printer.Format()) + return fmt.Errorf(`cannot switch query traffic with the output format "%s" (run with --force to override)`, ch.Printer.Format()) } if !printer.IsTTY { diff --git a/internal/printer/printer.go b/internal/printer/printer.go index d7e6886d..fdbc1749 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -41,8 +41,8 @@ func NewFormatValue(val Format, p *Format) *Format { return (*Format)(p) } -func (f *Format) String() string { - switch *f { +func (f Format) String() string { + switch f { case Human: return "human" case JSON: @@ -199,7 +199,7 @@ func (p *Printer) PrintResource(v interface{}) error { func (p *Printer) ConfirmCommand(confirmationName, commandShortName, confirmFailedName string) error { if p.Format() != Human { - return fmt.Errorf("cannot %s with the output format %q (run with --force to override)", commandShortName, p.Format()) + return fmt.Errorf(`cannot %s with the output format "%s" (run with --force to override)`, commandShortName, p.Format()) } if !IsTTY {