Get Last Value in Go

Posted by yhuang
Public (Editable by Users)
Go
Edit
package main

import (
	"fmt"
)

func main() {

	list := []string{"a", "b", "c"}
	fmt.Println(list[len(list)-1])
}