DevBits
Home
Atlas
Play
About
Sign up
Log in
All
Go
Collections
Lists
Set Value at Index
Set Value at Index in Go
Set Value at Index in Go
Posted by
yhuang
Public (Editable by Users)
Language
Go
Dependencies
import "fmt"
fmt.Println()
Run
Go 1.15.5
Play
Copy
Copy To
Official Go Playground
Expand
Fork
Edit
main.go
package main import ( "fmt" ) func main() { s := []int{1, 2, 3, 4, 5} s[2] = 999 fmt.Println(s) }
Stdout
Stderr