Source file tour/basics/type-conversions.go

     1  //go:build OMIT
     2  
     3  package main
     4  
     5  import (
     6  	"fmt"
     7  	"math"
     8  )
     9  
    10  func main() {
    11  	var x, y int = 3, 4
    12  	var f float64 = math.Sqrt(float64(x*x + y*y))
    13  	var z uint = uint(f)
    14  	fmt.Println(x, y, z)
    15  }
    16  

View as plain text