Skip to content

Instantly share code, notes, and snippets.

@basicmag
Created August 12, 2023 00:12
Show Gist options
  • Save basicmag/8c8650618a1f6fed979398fff7335790 to your computer and use it in GitHub Desktop.
Save basicmag/8c8650618a1f6fed979398fff7335790 to your computer and use it in GitHub Desktop.
Go言語: int から文字列への変換を strconv.Itoa で行う
// Go言語 必読本 Essential Go
// https://www.amazon.co.jp/dp/B0CF53VMYB
//
// Go言語: int から文字列への変換を strconv.Itoa で行う
package main
import (
"fmt"
"strconv"
)
func main() {
var i1 int = -38
fmt.Printf("i1: %s\n", strconv.Itoa(i1))
var i2 int32 = 148
fmt.Printf("i2: %s\n", strconv.Itoa(int(i2)))
}
// Go言語 必読本 Essential Go
// https://www.amazon.co.jp/dp/B0CF53VMYB
//
// Essential Go
// https://www.programming-books.io/essential/go/
// By Krzysztof Kowalczyk
//
// Content is licensed under Creative Commons Attribution-ShareAlike 3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment