Show First Transaction Panics
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
System Information
Version: v0.2.1-modified
System: windows/arm64
Go: go1.24.4
Source Revision: 11fe14208d539d4ff4237e3c06428836b8a9d823
## What did you do?
I executed `baronial show` on the first transaction in a repository.
## What did you expect to happen?
I expected a text representation of each field of a transaction displayed.
## What actually happened?
Go had a panic, and a stack trace gets dumped.
Stack Trace
panic: runtime error: index out of range [0] with length 0goroutine 1 [running]:
github.com/marstr/baronial/internal/format.PrettyPrintTransaction({0x7ff709a7eda0?, 0x4000068000?}, {0x7ff709a7c8f8?, _}, {_, _}, {0x4000094d10, {0x0, 0x0, 0x0}, ...})
C:/Users/marstr/code/github.com/marstr/baronial/internal/format/transaction.go:101 +0x5a8
github.com/marstr/baronial/cmd.init.func16(0x40000d8d00?, {0x4000094aa0, 0x1, 0x7ff7099fe688?})
C:/Users/marstr/code/github.com/marstr/baronial/cmd/show.go:68 +0x2d0
github.com/spf13/cobra.(*Command).execute(0x7ff709c782a0, {0x4000094a60, 0x1, 0x1})
C:/Users/marstr/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1019 +0x82c
github.com/spf13/cobra.(*Command).ExecuteC(0x7ff709c75c20)
C:/Users/marstr/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1148 +0x384
github.com/spf13/cobra.(*Command).Execute(...)
C:/Users/marstr/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1071
github.com/marstr/baronial/cmd.Execute()
C:/Users/marstr/code/github.com/marstr/baronial/cmd/root.go:85 +0x24
main.main()
C:/Users/marstr/code/github.com/marstr/baronial/main.go:21 +0x1c
Contributor guide
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 in internal/format/transaction.go at line 101, where PrettyPrintTransaction panics, and trace its call from cmd/show.go. Reproduce with baronial show on the first transaction, then verify that every transaction field is printed without a panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100