This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
var CalculateSum = calculateSum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
import "errors" | |
func FlatternArray(a interface{}, existing []int) ([]int, error) { | |
switch val := a.(type) { | |
case int: | |
return append(existing, val), nil | |
case []int: | |
return append(existing, val...), nil |