PHP » GoLang |
login |
register |
about
|
array_poparray_pop[code]
func ArrayPop(s *[]interface{}) interface{} {
if len(*s) == 0 {
return nil
}
ep := len(*s) - 1
e := (*s)[ep]
*s = (*s)[:ep]
return e
}
[/code]
|