Skip to content

Commit

Permalink
internal: fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cornelk committed Mar 12, 2024
1 parent d277fda commit 99bfbd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions internal/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func (dis *Disasm) handleJumpIntoInstruction(address uint16) {

offsetInfo := dis.mapper.offsetInfo(address)
if offsetInfo.Code == "" { // disambiguous instruction
offsetInfo.Comment = fmt.Sprintf("branch into instruction detected: %s", offsetInfo.Comment)
offsetInfo.Comment = "branch into instruction detected: " + offsetInfo.Comment
} else {
offsetInfo.Comment = fmt.Sprintf("branch into instruction detected: %s", offsetInfo.Code)
offsetInfo.Comment = "branch into instruction detected: " + offsetInfo.Code
offsetInfo.Code = ""
}

Expand All @@ -97,9 +97,9 @@ func (dis *Disasm) handleDisambiguousInstructions(address uint16, offsetInfo *of
}

if offsetInfo.Code == "" { // in case of branch into unofficial nop instruction detected
offsetInfo.Comment = fmt.Sprintf("disambiguous instruction: %s", offsetInfo.Comment)
offsetInfo.Comment = "disambiguous instruction: " + offsetInfo.Comment
} else {
offsetInfo.Comment = fmt.Sprintf("disambiguous instruction: %s", offsetInfo.Code)
offsetInfo.Comment = "disambiguous instruction: " + offsetInfo.Code
}

offsetInfo.Code = ""
Expand Down
2 changes: 1 addition & 1 deletion internal/disasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func getProgramOffset(address uint16, offsetInfo offset, options *options.Disass
}

if offsetInfo.IsType(program.FunctionReference) {
programOffset.Code = fmt.Sprintf(".word %s", offsetInfo.branchingTo)
programOffset.Code = ".word " + offsetInfo.branchingTo
}

if err := setComment(address, &programOffset, options); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions internal/disasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestDisasmZeroDataReference(t *testing.T) {
.byte $00 ; $8020
`

setup := func(options *options.Disassembler, cart *cartridge.Cartridge) {
setup := func(_ *options.Disassembler, cart *cartridge.Cartridge) {
cart.PRG[0x0010] = 0x12
cart.PRG[0x0015] = 0x34
}
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestDisasmDifferentCodeBaseAddress(t *testing.T) {
rti ; $C006 40
`

setup := func(options *options.Disassembler, cart *cartridge.Cartridge) {
setup := func(_ *options.Disassembler, cart *cartridge.Cartridge) {
cart.PRG = make([]byte, 0x4000)
cart.PRG[0x3FFD] = 0xC0 // reset handler that forces base address to $C000
}
Expand All @@ -298,7 +298,7 @@ func TestDisasmIndirectJmp(t *testing.T) {
jmp ($20CE) ; $8000 6C CE 20
`

setup := func(options *options.Disassembler, cart *cartridge.Cartridge) {}
setup := func(_ *options.Disassembler, _ *cartridge.Cartridge) {}

runDisasm(t, setup, input, expected)
}
Expand Down

0 comments on commit 99bfbd2

Please sign in to comment.