mirror of https://github.com/go-python/gopy.git
18 lines
342 B
Go
18 lines
342 B
Go
// Copyright 2017 The go-python Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package arrays
|
|
|
|
func IntSum(a [4]int) int {
|
|
sum := 0
|
|
for i := 0; i < len(a); i++ {
|
|
sum += a[i]
|
|
}
|
|
return sum
|
|
}
|
|
|
|
func CreateArray() [4]int {
|
|
return [4]int{1, 2, 3, 4}
|
|
}
|