If you need to raise a number to a power in Golang, then you can use the math.Pow function:

1
2
3
4
5
6
7
8
9
package main  
import (
  "math"  
)  
  
func main() {  
  var exponent, base float64
  output := math.Pow(base, exponent)  
}