1.

How to swap two values in golang?

Answer»

package MAIN
import "fmt"
FUNC main() {
   fmt.Println(functionByBestInterviewQuestion())
}

func functionByBestInterviewQuestion() []INT {
   a, b := 15, 10
   b, a = a, b
   return []int{a, b}
}



Discussion

No Comment Found