This time a map remembers every value already visited. Each step costs one lookup: a hit means the number appeared earlier, so the function returns true; a miss means store it and keep going. Hash lookups and inserts are O(1) on average, which makes the full scan O(n).
Nothing needs to live next to a key, so the value type is struct{}, which occupies zero bytes and turns the map into a pure membership table. Indexing a missing key would hand back the zero value, which tells you nothing here, so the code uses the two-value form _, ok := seen[n]: ok alone says whether the key exists, and the blank identifier throws away the empty value. Storing a key is seen[n] = struct{}{}, and the len(nums) passed to make is a size hint, not a length.