Skip to content

Instantly share code, notes, and snippets.

@FairlySadPanda
Last active April 24, 2026 15:17
Show Gist options
  • Select an option

  • Save FairlySadPanda/67c8d7c2dbc6c9cf018ecab58666cfd5 to your computer and use it in GitHub Desktop.

Select an option

Save FairlySadPanda/67c8d7c2dbc6c9cf018ecab58666cfd5 to your computer and use it in GitHub Desktop.
Output of golangci-lint run on tinyemu-go
cmd/temu/main.go:199:12: Error return value of `bd.Close` is not checked (errcheck)
bd.Close()
^
cmd/temu/main.go:228:15: Error return value of `p9Dev.Close` is not checked (errcheck)
p9Dev.Close()
^
cmd/temu/main.go:627:10: Error return value of `cpu.Run` is not checked (errcheck)
cpu.Run(maxExecCycle)
^
cmd/temu/main_test.go:32:16: Error return value of `bd.Close` is not checked (errcheck)
defer bd.Close()
^
cmd/temu/main_test.go:82:16: Error return value of `bd.Close` is not checked (errcheck)
defer bd.Close()
^
cmd/temu/main_test.go:433:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(originalData)
^
cmd/temu/main_test.go:434:9: Error return value of `w.Close` is not checked (errcheck)
w.Close()
^
cmd/temu/main_test.go:565:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(diskData)
^
cmd/temu/main_test.go:566:9: Error return value of `w.Close` is not checked (errcheck)
w.Close()
^
cmd/temu/main_test.go:569:14: Error return value of `os.WriteFile` is not checked (errcheck)
os.WriteFile(xzPath, compressed.Bytes(), 0644)
^
cmd/temu/terminal_linux.go:80:23: Error return value of `unix.IoctlSetTermios` is not checked (errcheck)
unix.IoctlSetTermios(fd, unix.TCSETS, origTermios)
^
cmd/temu/terminal_linux.go:90:22: Error return value of `unix.IoctlSetTermios` is not checked (errcheck)
unix.IoctlSetTermios(t.fd, unix.TCSETS, &t.origTermios)
^
cmd/temu/terminal_linux.go:91:15: Error return value of `unix.FcntlInt` is not checked (errcheck)
unix.FcntlInt(uintptr(t.fd), unix.F_SETFL, t.origFlags)
^
machine/boot_test.go:86:20: Error return value of `rootfs.Close` is not checked (errcheck)
defer rootfs.Close()
^
machine/boot_test.go:180:13: Error return value of `cpuDev.Run` is not checked (errcheck)
cpuDev.Run(cyclesPerCheck)
^
machine/boot_test.go:411:13: Error return value of `cpuDev.Run` is not checked (errcheck)
cpuDev.Run(cyclesPerCheck)
^
machine/boot_test.go:628:13: Error return value of `cpuDev.Run` is not checked (errcheck)
cpuDev.Run(cyclesPerCheck)
^
machine/boot_test.go:1108:12: Error return value of `conn.Close` is not checked (errcheck)
conn.Close()
^
machine/boot_test.go:1502:22: Error return value of `listener.Close` is not checked (errcheck)
defer listener.Close()
^
machine/boot_test.go:1520:10: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte("HTTPS_SUCCESS\n"))
^
machine/boot_test.go:1524:17: Error return value of `server.Serve` is not checked (errcheck)
go server.Serve(listener)
^
machine/boot_test.go:1525:20: Error return value of `server.Close` is not checked (errcheck)
defer server.Close()
^
machine/boot_test.go:1883:20: Error return value of `rootfs.Close` is not checked (errcheck)
defer rootfs.Close()
^
machine/boot_test.go:2138:20: Error return value of `rootfs.Close` is not checked (errcheck)
defer rootfs.Close()
^
machine/boot_test.go:2189:19: Error return value of `p9Dev.Close` is not checked (errcheck)
defer p9Dev.Close()
^
machine/boot_test.go:2432:10: Error return value of `cpu.Run` is not checked (errcheck)
cpu.Run(1)
^
machine/boot_test.go:2494:10: Error return value of `cpu.Run` is not checked (errcheck)
cpu.Run(1)
^
machine/boot_test.go:3761:22: Error return value of `listener.Close` is not checked (errcheck)
defer listener.Close()
^
machine/boot_test.go:3778:19: Error return value of `conn.Close` is not checked (errcheck)
defer conn.Close()
^
machine/boot_test.go:3795:13: Error return value of `conn.Write` is not checked (errcheck)
conn.Write([]byte(response))
^
machine/boot_test.go:4345:21: Error return value of `conn.Close` is not checked (errcheck)
defer conn.Close()
^
machine/boot_test.go:4351:25: Error return value of `conn.SetReadDeadline` is not checked (errcheck)
conn.SetReadDeadline(time.Now().Add(10 * time.Second))
^
machine/boot_test.go:4466:16: Error return value of `testConn.Close` is not checked (errcheck)
testConn.Close()
^
machine/machine_test.go:441:15: Error return value of `(*github.com/jtolio/tinyemu-go/cpu.CPU).Run` is not checked (errcheck)
m.CPU().Run(1)
^
mem/physmem_test.go:164:15: Error return value of `m.RegisterRAM` is not checked (errcheck)
m.RegisterRAM(0x80000000, 0x10000, 0) // 64KB at 0x80000000
^
mem/physmem_test.go:165:15: Error return value of `m.RegisterRAM` is not checked (errcheck)
m.RegisterRAM(0x90000000, 0x10000, 0) // 64KB at 0x90000000
^
mem/physmem_test.go:201:15: Error return value of `m.RegisterRAM` is not checked (errcheck)
m.RegisterRAM(0x80000000, 4096, 0)
^
mem/physmem_test.go:313:18: Error return value of `m.RegisterDevice` is not checked (errcheck)
m.RegisterDevice(0x10000000, 0x1000, nil, readFn, writeFn, DevIOSize32)
^
mem/physmem_test.go:367:18: Error return value of `m.RegisterDevice` is not checked (errcheck)
m.RegisterDevice(0x10000000, 0x1000, nil, readFn, writeFn, DevIOSize32)
^
mem/physmem_test.go:522:11: Error return value of `m.Write32` is not checked (errcheck)
m.Write32(0x80000000, 0x12345678)
^
mem/physmem_test.go:622:17: Error return value of `m2.RegisterRAM` is not checked (errcheck)
m2.RegisterRAM(0x0, 0x10000, 0)
^
mem/physmem_test.go:665:18: Error return value of `m.RegisterDevice` is not checked (errcheck)
m.RegisterDevice(0x10000000, 0x1000, nil, readFn, writeFn, DevIOSize32)
^
p9/hostfs.go:194:11: Error return value of `fd.Close` is not checked (errcheck)
fd.Close()
^
p9/hostfs.go:252:17: Error return value of `hf.dir.Close` is not checked (errcheck)
hf.dir.Close()
^
p9/hostfs.go:257:16: Error return value of `hf.fd.Close` is not checked (errcheck)
hf.fd.Close()
^
p9/hostfs.go:271:9: Error return value of `h.Clunk` is not checked (errcheck)
h.Clunk(f)
^
p9/hostfs_test.go:19:20: Error return value of `os.RemoveAll` is not checked (errcheck)
defer os.RemoveAll(tmpDir)
^
p9/hostfs_test.go:38:14: Error return value of `os.WriteFile` is not checked (errcheck)
os.WriteFile(tmpFile, []byte("test"), 0644)
^
p9/hostfs_test.go:47:10: Error return value of `os.Mkdir` is not checked (errcheck)
os.Mkdir(realDir, 0755)
^
p9/hostfs_test.go:49:12: Error return value of `os.Symlink` is not checked (errcheck)
os.Symlink(realDir, symlinkPath)
^
devices/block_file_test.go:123:2: ineffectual assignment to n (ineffassign)
n, err = bd.ReadSectors(0, readData, 1)
^
devices/block_file_test.go:158:2: ineffectual assignment to n (ineffassign)
n, err = bd.ReadSectors(2, readData, 3)
^
devices/block_snapshot_test.go:66:2: ineffectual assignment to n (ineffassign)
n, err = snap.ReadSectors(1, readData2, 1)
^
machine/fdt.go:364:2: ineffectual assignment to curPhandle (ineffassign)
curPhandle++
^
mem/physmem_test.go:359:2: ineffectual assignment to ptr (ineffassign)
ptr = m.GetRAMPtr(0x80000000, true)
^
slirp/tcp_input.go:908:4: ineffectual assignment to tiUrp (ineffassign)
tiUrp = 0
^
slirp/tcp_input_test.go:1633:2: ineffectual assignment to flags (ineffassign)
flags = s.tcpReass(tp, ti2, m2)
^
slirp/tcp_input_test.go:1651:2: ineffectual assignment to flags (ineffassign)
flags := s.tcpReass(tp, ti2, m2)
^
cmd/temu/main_test.go:274:2: SA4006: this value of cfg is never used (staticcheck)
cfg, err = buildConfigFromCLI()
^
cmd/temu/slirp_linux.go:19:15: ST1005: error strings should not end with punctuation or newlines (staticcheck)
return nil, fmt.Errorf("Unsupported network driver '%s'\n", driver)
^
cpu/exec.go:93:3: SA9003: empty branch (staticcheck)
if err := c.Step(); err != nil {
^
cpu/exec.go:739:4: QF1003: could use tagged switch on funct7 (staticcheck)
if funct7 == 0x20 {
^
cpu/exec.go:809:4: QF1003: could use tagged switch on funct7 (staticcheck)
if funct7 == 0x20 {
^
cpu/priv.go:52:16: SA4000: identical expressions on the left and right side of the '-' operator (staticcheck)
MisaA = 1 << ('A' - 'A') // Atomic extension
^
cpu/trace.go:107:2: QF1007: could merge conditional assignment into variable declaration (staticcheck)
shouldTrace := false
^
p9/hostfs_test.go:1252:8: QF1011: could omit type File from declaration; it will be inferred from the right-hand side (staticcheck)
var f File = root
^
slirp/cksum_test.go:159:2: SA9003: empty branch (staticcheck)
if result == 0 {
^
slirp/misc_test.go:46:8: QF1011: could omit type uint32 from declaration; it will be inferred from the right-hand side (staticcheck)
var _ uint32 = GetTimeMs()
^
slirp/socket.go:120:3: QF1003: could use tagged switch on so.SoType (staticcheck)
if so.SoType == IPProtoUDP {
^
slirp/socket.go:140:3: QF1003: could use tagged switch on so (staticcheck)
if so == slirp.TCPLastSo {
^
slirp/tcp_input.go:196:4: SA4006: this value of tp is never used (staticcheck)
tp = tp.TCPClose()
^
slirp/tcp_input.go:639:3: SA4006: this value of tp is never used (staticcheck)
tp = tp.TCPClose()
^
slirp/tcp_input.go:652:5: SA4006: this value of tp is never used (staticcheck)
tp = tp.TCPClose()
^
slirp/tcp_input.go:720:4: QF1003: could use tagged switch on ret (staticcheck)
if ret == 1 {
^
slirp/tcp_input_test.go:2994:2: SA9003: empty branch (staticcheck)
if sum == 0 {
^
softfp/f32.go:447:5: QF1001: could apply De Morgan's law (staticcheck)
if !(rExp > cExp || (rExp == cExp && rMant1 >= cMant1)) {
^
softfp/f64.go:492:5: QF1001: could apply De Morgan's law (staticcheck)
if !(rExp > cExp || (rExp == cExp && rMant1 >= cMant1)) {
^
temubox/reader.go:77:15: SA6002: argument should be pointer-like to avoid allocations (staticcheck)
r.pool.Put(oldBuf)
^
virtio/mmio.go:483:3: QF1006: could lift into loop condition (staticcheck)
if desc.Flags&VRingDescFWrite != 0 {
^
virtio/mmio.go:607:4: QF1006: could lift into loop condition (staticcheck)
if desc.Flags&VRingDescFWrite != 0 {
^
cmd/temu/terminal_linux.go:21:2: const tcsaNOW is unused (unused)
tcsaNOW = 0 // Make changes immediately
^
cmd/temu/terminal_linux.go:22:2: const tcsaDRAIN is unused (unused)
tcsaDRAIN = 1 // Make changes after draining output
^
cmd/temu/terminal_linux.go:23:2: const tcsaFLUSH is unused (unused)
tcsaFLUSH = 2 // Make changes after flushing
^
p9/hostfs.go:18:2: field mu is unused (unused)
mu sync.RWMutex
^
slirp/integration_test.go:135:22: func (*testHelper).buildDHCPDiscover is unused (unused)
func (h *testHelper) buildDHCPDiscover(xid uint32) []byte {
^
slirp/integration_test.go:157:22: func (*testHelper).buildDHCPRequest is unused (unused)
func (h *testHelper) buildDHCPRequest(xid uint32, requestedIP net.IP) []byte {
^
slirp/ip_input_test.go:458:6: func buildFragmentedPacket is unused (unused)
func buildFragmentedPacket(proto uint8, src, dst net.IP, ttl uint8, id uint16, fragOffset uint16, moreFragments bool, payload []byte) []byte {
^
slirp/trace.go:51:17: func (*Slirp).trace is unused (unused)
func (s *Slirp) trace(format string, args ...interface{}) {
^
softfp/f128.go:127:6: func boolToU128 is unused (unused)
func boolToU128(b bool) Uint128 {
^
softfp/f128.go:251:6: func normalize2Float128 is unused (unused)
func normalize2Float128(sign uint32, exp int32, mant1, mant0 Uint128, rm RoundingMode, flags *ExceptionFlags) Uint128 {
^
softfp/f32_test.go:31:2: var negSubnorm32 is unused (unused)
negSubnorm32 = uint32(0x80000001)
^
softfp/f32_test.go:33:2: var negMaxNorm32 is unused (unused)
negMaxNorm32 = uint32(0xFF7FFFFF) // Max finite negative
^
softfp/f64_test.go:31:2: var negSubnorm64 is unused (unused)
negSubnorm64 = uint64(0x8000000000000001)
^
softfp/f64_test.go:33:2: var negMaxNorm64 is unused (unused)
negMaxNorm64 = uint64(0xFFEFFFFFFFFFFFFF) // Max finite negative
^
softfp/f64_test.go:34:2: var posMinNorm64 is unused (unused)
posMinNorm64 = uint64(0x0010000000000000) // Min positive normal
^
virtio/p9.go:30:2: field nextFid is unused (unused)
nextFid uint32
^
96 issues:
* errcheck: 50
* ineffassign: 8
* staticcheck: 22
* unused: 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment