Brendan Ang

Search

Search IconIcon to open search

Arrays and Slices

Last updated Nov 8, 2022 Edit Source

# Arrays and Slices

# Arrays

Screenshot 2022-08-24 at 6.33.10 PM

# Slices

# Slice reallocation

# Deletion

# Pitfalls

Since a slice is a pointer to an array, passing a slice into a function will allow the function to modify the original array.

However, if slice reallocation occurs inside this new function, the function will no longer be modifying the original array: To avoid this, we can return the modified array from the func

# Goroutine Unsafety