Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lilyball
on Dec 15, 2019
|
parent
|
context
|
favorite
| on:
API Practices If You Hate Your Customers
If the nil value for a slice is the empty slice, then why do the following two variable definitions differ in behavior?
var x []int; y := []int{};
Both produce a slice of capacity zero, except `x` serializes to null and `y` serializes to an empty array.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: