Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does Go perform interning of strings?


Compile-time strings, I think so? In that all identical strings simply point to the same data. Otherwise no.


Use of Go’s runtime reflection to produce a struct definition would result in one instance of the key string, many instances of the numeric value

This approach is available/implemented in the standard library, the whole story with JSON in Go is includes a few different approaches but this is definitely anticipated.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: