Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Go
/
Reflection
Why would a decoder use StructTag.Lookup("config") instead of Get("config")?
from Reflection
Go 1.27
intermediate
1 min
Why would a decoder use StructTag.Lookup("config") instead of Get("config")?
Lookup distinguishes a missing key from a present key with an empty value.
Lookup validates the tag according to encoding/json rules.
Lookup returns the field index path together with the tag.
Get cannot read tags on exported fields.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in the IsNil helper
Spot the bug
next kata
Which check is the right default before setting one reflect.Value from another?
Quiz
A new version is available
Reload