Skip to content

Bug Report: Compilation Error - Missing Methods in tablewriter.Table #286

@rymiyamoto

Description

@rymiyamoto

Description

The sql-migrate package fails to compile due to missing methods (SetHeader and SetColWidth) in the tablewriter.Table type.

Environment

  • Go version: go version go1.24.4 linux/arm64
  • Operating system: Linux (e.g., Ubuntu 22.04)
  • sql-migrate version: v1.8.0

Error Message

$ go tool github.com/rubenv/sql-migrate/sql-migrate up -config dbconf.yml
/go/pkg/mod/github.com/rubenv/[email protected]/sql-migrate/command_status.go:74:8: table.SetHeader undefined (type tablewriter.Table has no field or method SetHeader)
/go/pkg/mod/github.com/rubenv/[email protected]/sql-migrate/command_status.go:75:8: table.SetColWidth undefined (type tablewriter.Table has no field or method SetColWidth)

Steps to Reproduce

  1. Import or use github.com/rubenv/[email protected]
  2. Run the following command in the terminal:
    $ go tool github.com/rubenv/sql-migrate/sql-migrate up -config dbconf.yml

Expected Behavior

The package should compile successfully without any undefined method errors.

Attempted Solutions

  • Ran go mod tidy
  • Cleared module cache with go clean -modcache
  • Updated dependencies with go get -u ./...
  • Tried rebuilding with go clean -cache && go build

Additional Context

This appears to be a dependency version mismatch issue between sql-migrate and the github.com/olekukonko/tablewriter package. The methods SetHeader and SetColWidth seem to be missing or have been renamed in the current version of tablewriter.

Possible Fix

The issue might be resolved by:

  1. Updating the tablewriter dependency to a compatible version
  2. Or updating the method calls to use the correct API from the current tablewriter version

Related Files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions