Bug Report: Compilation Error - Missing Methods in tablewriter.Table
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.4k
- Forks
- 292
- PR merge metrics
- No merged PRs in 30d
Description
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/sql-migrate@v1.8.0/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/sql-migrate@v1.8.0/sql-migrate/command_status.go:75:8: table.SetColWidth undefined (type tablewriter.Table has no field or method SetColWidth)
Steps to Reproduce
- Import or use
github.com/rubenv/sql-migrate@v1.8.0 - 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:
- Updating the tablewriter dependency to a compatible version
- Or updating the method calls to use the correct API from the current tablewriter version
Related Files
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sql-migrate/command_status.go at the reported lines and reproduce the failure with the go tool ... sql-migrate up -config dbconf.yml command. Check the tablewriter dependency and its available API, then verify that the package builds without undefined SetHeader or SetColWidth methods.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100