Error map

panic: interface conversion Go: panic: interface conversion: interface {} is string, not int

Go · layer 4, Application & API

Open the full error page →

Centre: this error. First ring: errors it is linked with (9). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

panic: interface conversion — Go: panic: interface conversion: interface {} is string, not int (Go)panic: inte…invalid memory address or nil pointer dereference — Go: panic: runtime error: invalid memory address or nil pointer dereference (Go)invalid memory addr…panic: assignment to entry in nil map — Go: panic: assignment to entry in nil map (Go)panic: assignment t…json: cannot unmarshal string into Go struct field — Go: json: cannot unmarshal string into Go struct field User.age of type int (Go)json: cannot unmars…fatal error: stack overflow — Go: runtime: goroutine stack exceeds 1000000000-byte limit — fatal error: stack overflow (Go)fatal error: stack …reflect: call of reflect.Value.X on zero Value — Go: panic: reflect: call of reflect.Value.Elem on zero Value (Go)reflect: call of re…does not implement interface (missing method) — Go: cannot use &Dog{} (value of type *Dog) as Animal value: *Dog does not implement Animal (missing method Speak) (Go)does not implement …panic: runtime error: index out of range — Go: panic: runtime error: index out of range [3] with length 3 (Go)panic: runtime erro…panic: slice bounds out of range — Go: panic: runtime error: slice bounds out of range [:5] with capacity 3 (Go)panic: slice bounds…panic: runtime error: integer divide by zero — Go: panic: runtime error: integer divide by zero (Go)panic: runtime erro…SIGSEGV — Segmentation fault (core dumped) (Linux)SIGSEGVall goroutines are asleep - deadlock — Go: fatal error: all goroutines are asleep - deadlock! (Go)all goroutines are …declared and not used — Go: declared and not used: x / "fmt" imported and not used (Go)declared and not us…cannot assign to struct field m[k].f in map — Go: cannot assign to struct field users["bob"].Age in map (Go)cannot assign to st…fatal error: concurrent map writes — Go: fatal error: concurrent map writes (Go)fatal error: concur…fatal error: concurrent map read and map write — Go: fatal error: concurrent map read and map write (Go)fatal error: concur…assignment mismatch: 1 variable but f returns 2 values — Go: assignment mismatch: 1 variable but os.Open returns 2 values (Go)assignment mismatch…cannot refer to unexported name — Go: cannot refer to unexported name pkg.helper (undefined: pkg.helper) (Go)cannot refer to une…invalid character looking for beginning of value — Go: invalid character '<' looking for beginning of value (Go)invalid character l…imported and not used — Go: ./main.go:5:2: "os" imported and not used (Go)imported and not us…undefined: x — Go: ./main.go:12:2: undefined: handler (Go)undefined: xmissing return — Go: ./main.go:18:1: missing return (Go)missing return

Directly related (9)

invalid memory address or nil pointer dereferenceGo

Go: panic: runtime error: invalid memory address or nil pointer dereference

The program used a pointer, map, interface or struct field that was nil — usually an uninitialised value or an ignored error.

panic: assignment to entry in nil mapGo

Go: panic: assignment to entry in nil map

You wrote to a map that was declared but never initialised.

json: cannot unmarshal string into Go struct fieldGo

Go: json: cannot unmarshal string into Go struct field User.age of type int

The JSON value's type does not match the Go field type (string vs number, object vs array).

fatal error: stack overflowGo

Go: runtime: goroutine stack exceeds 1000000000-byte limit — fatal error: stack overflow

Unbounded recursion consumed the goroutine's stack until it hit the 1 GB limit.

reflect: call of reflect.Value.X on zero ValueGo

Go: panic: reflect: call of reflect.Value.Elem on zero Value

Reflection code operated on an invalid (zero) `reflect.Value`, often derived from a nil pointer or a missing struct field.

does not implement interface (missing method)Go

Go: cannot use &Dog{} (value of type *Dog) as Animal value: *Dog does not implement Animal (missing method Speak)

A type was used as an interface but lacks a method or has it with a different signature or receiver type.

panic: runtime error: index out of rangeGo

Go: panic: runtime error: index out of range [3] with length 3

Code accessed a slice, array or string element beyond its length.

panic: slice bounds out of rangeGo

Go: panic: runtime error: slice bounds out of range [:5] with capacity 3

A slice expression `s[a:b]` used bounds outside the slice's length or capacity.

panic: runtime error: integer divide by zeroGo

Go: panic: runtime error: integer divide by zero

Integer division or modulo by zero.

Two steps away (12)

SIGSEGVLinux

Segmentation fault (core dumped)

A program accessed memory it wasn’t allowed to, and the kernel killed it with SIGSEGV (exit code 139).

all goroutines are asleep - deadlockGo

Go: fatal error: all goroutines are asleep - deadlock!

Every goroutine is blocked waiting (on a channel, mutex or WaitGroup), so the program can never continue.

declared and not usedGo

Go: declared and not used: x / "fmt" imported and not used

Go refuses to compile code with unused local variables or unused imports.

cannot assign to struct field m[k].f in mapGo

Go: cannot assign to struct field users["bob"].Age in map

Map values are not addressable, so you cannot modify a field of a struct stored directly in a map.

fatal error: concurrent map writesGo

Go: fatal error: concurrent map writes

Two goroutines wrote to the same map at the same time; the runtime detects it and aborts the program (not recoverable).

fatal error: concurrent map read and map writeGo

Go: fatal error: concurrent map read and map write

One goroutine read from a map while another wrote to it; the runtime aborts.

assignment mismatch: 1 variable but f returns 2 valuesGo

Go: assignment mismatch: 1 variable but os.Open returns 2 values

The number of variables on the left does not match the number of values the function returns.

cannot refer to unexported nameGo

Go: cannot refer to unexported name pkg.helper (undefined: pkg.helper)

You used a lowercase (unexported) identifier from another package; only capitalised names are visible outside their package.

invalid character looking for beginning of valueGo

Go: invalid character '<' looking for beginning of value

The decoder received something that is not JSON — often an HTML error page, an empty body or plain text.

imported and not usedGo

Go: ./main.go:5:2: "os" imported and not used

The file imports a package that no code in that file uses; Go treats this as a compile error, not a warning.

undefined: xGo

Go: ./main.go:12:2: undefined: handler

The compiler cannot find an identifier — a typo, a missing import, or it lives in another file/package that wasn't built.

missing returnGo

Go: ./main.go:18:1: missing return

A function with a return type can reach its end without a return statement on some path.