Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gopher-dojo-lt.pdf

ogidow
December 03, 2018
83

 Gopher-dojo-lt.pdf

ogidow

December 03, 2018
Tweet

Transcript

  1. (Pݴޠͩͱ ۪௚ʹ࣮૷ package main import ( "fmt" ) func main()

    { arr := []string{"hoge", "fuga", "foo"} fmt.Println(reverseArray(arr)) } func reverseArray(arr []string) []string { maxLen := len(arr) res := []string{} for i := maxLen - 1; i >= 0; i-- { res = append(res, arr[i]) } return res }