Skip to content

Instantly share code, notes, and snippets.

@bam6o0
Created July 29, 2017 08:23
Show Gist options
  • Save bam6o0/7c05b2c304d11e152536f106175cc64a to your computer and use it in GitHub Desktop.
Save bam6o0/7c05b2c304d11e152536f106175cc64a to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
//int型で宣言
var i int = 1234
//int型からunit32型への変換
var u uint32 = uint32(i)
//unit型からfloat型への変換
var f float32 = float32(u)
//int型からstring型への変換
var s string = string(i)
//string型からスライス型への変換
var b []byte = []byte(s)
fmt.Println(u)
fmt.Println(f)
fmt.Println(s)
fmt.Println(b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment