🌐
Go Packages
pkg.go.dev › strconv
strconv package - strconv - Go Packages
Package strconv implements conversions to and from string representations of basic data types.
🌐
GeeksforGeeks
geeksforgeeks.org › go language › strconv-package-in-golang
strconv package in Golang - GeeksforGeeks
July 15, 2025 - To access the functions of the strconv package you need to import the strconv package in your program with the help of the import keyword. Example 1: go · // Golang program to illustrate the // strconv.AppendQuoteRuneToASCII() function package main import ( "fmt" "strconv" ) func main() { // Converting Unicode characters to // ASCII strings resulting from "single quotes" // append the result to the end of the given []byte // Using AppendQuoteRuneToASCII() function num := []byte("Rune : ") num = strconv.AppendQuoteRuneToASCII(num, 'c') fmt.Println(string(num)) } Output: Rune : 'c' Example 2 : go ·
Discussions

The Go hate list
strconv.Atoi() and strconv.Itoa() that have pretty silly names Pretty sure they are just mirroring the names of the well known C functions: https://www.cplusplus.com/reference/cstdlib/itoa/ . I think those functions have been around since at least the 70s? Atoi stands for ASCII to integer. You can probably guess what Itoa stands for based on that... More on reddit.com
🌐 r/golang
40
0
April 15, 2022
proposal: strconv: add generic integer variants
Proposal Details I had an argument with @ldemailly on what is the least ugly to stringify a ~uint8 (typed iota enum) to a base ten number. strconv.FormatUint(uint64(i), 10) is verbose so it seems p... More on github.com
🌐 github.com
14
April 29, 2024
proposal: strconv: Add Parse[T]
I'd like to propose a generic interface to the parsing functionality provided by strconv. type Types interface { string | bool | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uin... More on github.com
🌐 github.com
25
January 24, 2023
🌐
Medium
medium.com › go-walkthrough › go-walkthrough-strconv-7a24632a9e73
Go Walkthrough: strconv. Fast, efficient, & safe primitive… | by Ben Johnson | Go Walkthrough | Medium
August 1, 2017 - The strconv package is built for speed. It’s great for when you need to handle primitive value formatting while minimizing allocations and CPU cycles.
🌐
Reintech
reintech.io › term › using-strconv-parsefloat-function-go
Using strconv.ParseFloat() Function in Go | Reintech media
In this tutorial, we explored the essential functions provided by the `strconv` package in Go for converting strings to and from various numeric types, such as integers, floats, and booleans.
🌐
Go Packages
pkg.go.dev › fmt
fmt package - fmt - Go Packages
'+' always print a sign for numeric values; guarantee ASCII-only output for %q (%+q) '-' pad with spaces on the right rather than the left (left-justify the field) '#' alternate format: add leading 0b for binary (%#b), 0 for octal (%#o), 0x or 0X for hex (%#x or %#X); suppress 0x for %p (%#p); for %q, print a raw (backquoted) string if [strconv.CanBackquote] returns true; always print a decimal point for %e, %E, %f, %F, %g and %G; do not remove trailing zeros for %g and %G; write e.g.
🌐
Go Packages
pkg.go.dev › github.com › pmcanseco › go-satellite › strconv
strconv package - github.com/pmcanseco/go-satellite/strconv - Go Packages
March 12, 2023 - Common problems companies solve with Go · Stories about how and why companies use Go
Find elsewhere
🌐
Dot Net Perls
dotnetperls.com › parseint-go
Go - ParseInt Examples: Convert String to Int - Dot Net Perls
package main import ( "fmt" "strconv" ) func main() { value := "123" // Convert string to int.
🌐
Reddit
reddit.com › r/golang › the go hate list
r/golang on Reddit: The Go hate list
April 15, 2022 -

These are the things that I don't like, I don't understand or I just cannot wrap my head around in Go. Most of them are just preferences and issues of mine as I'm coming from the JavaScript world, not issues of the language per se. This is not a rant, just food for thought, a little salty. Share yours if you want, please be kind

  1. Why do I have to mess with type conversions at all?

  2. Editor support is lacking (VS Code specifically)?

  3. There seems to be no real central registry for packages

  4. Implicit interfaces can lead to madness

  5. Implicit export of Capitalized stuff is weird

  6. There's make(), but also new() and it's confusing

  7. There are arrays, but we don't do this here, use slices if needed

  8. There's reflection, but anyone using reflection is frowned upon (and should be)

  9. There are pointers, but it's just to avoid repetitive allocations of the same values here and there

  10. No classes here, inheritance is bad (and it is), but mimic'ing a class anyway via structs and receiving functions is no fun anyway

  11. stdlib is good, and yet there's strconv.Atoi() and strconv.Itoa() that have pretty silly names and are not part of the "strings" package?

  12. Obsession with short names is pedantic, I don't need "bufio", I need "buffer-io" or something

🌐
DEV Community
dev.to › schadokar › convert-string-to-int-and-int-to-string-in-golang-dmb
Convert String to Int and Int to String in Golang - DEV Community
March 28, 2020 - Package strconv implements conversions to and from string representations of basic data types.
🌐
Go Packages
pkg.go.dev › github.com › savsgio › gotils › strconv
strconv package - github.com/savsgio/gotils/strconv - Go Packages
B2S converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
🌐
mkaz.blog
mkaz.blog › working-with-go › numbers
Numbers - mkaz.blog
See strconv package documentation. The strconv package contains various functions for converting strings to default types. Here is how to convert a string to an integer in golang:
🌐
GitHub
github.com › golang › go › issues › 67110
proposal: strconv: add generic integer variants · Issue #67110 · golang/go
April 29, 2024 - Proposal Details I had an argument with @ldemailly on what is the least ugly to stringify a ~uint8 (typed iota enum) to a base ten number. strconv.FormatUint(uint64(i), 10) is verbose so it seems people would enjoy using strconv.Itoa mor...
Author   Jorropo
🌐
GitHub
github.com › golang › go › issues › 57975
proposal: strconv: Add Parse[T] · Issue #57975 · golang/go
January 24, 2023 - func QueryValue[T strconv.Types](q url.Values, key string) (T, error) { v := q.Get(key) if v == "" { var z T return z, fmt.Errorf("query value not found: %q", key) } return strconv.Parse[T](v) }
Author   icholy
🌐
Go
go.dev › play › p › r5dG6X5YuF
Go Playground - The Go Programming Language
Any requests for content removal should be directed to security@golang.org.
🌐
IncludeHelp
includehelp.com › golang › strconv-parseuint-function-with-examples.aspx
Golang strconv.ParseUint() Function with Examples
// Golang program to demonstrate the // example of strconv.ParseUint() Function package main import ( "fmt" "strconv" ) func main() { v := "12345678" s, err := strconv.ParseUint(v, 10, 32) if err == nil { fmt.Println("Parsing done...") fmt.Printf("%T, %v\n", s, s) } else { fmt.Println("Parsing failed...") fmt.Printf("Error:%v\n", err) } fmt.Println() v = "123456789098765" s, err = strconv.ParseUint(v, 10, 64) if err == nil { fmt.Println("Parsing done...") fmt.Printf("%T, %v\n", s, s) } else { fmt.Println("Parsing failed...") fmt.Printf("Error:%v\n", err) } fmt.Println() v = "123456789098765432
🌐
Go Packages
pkg.go.dev › cuelang.org › go › pkg › strconv
strconv package - cuelang.org/go/pkg/strconv - Go Packages
March 3, 2026 - If s is not syntactically well-formed, ParseNumber returns a *strconv.NumError with Err containing detailed syntax information.
🌐
GeeksforGeeks
geeksforgeeks.org › go language › strconv-atoi-function-in-golang-with-examples
strconv.Atoi() Function in Golang With Examples - GeeksforGeeks
April 21, 2020 - To access Atoi() function you need to import strconv Package in your program. Syntax: func Atoi(str string) (int, error) Here, str is the string. Example 1: ... // Golang program to illustrate // strconv.Atoi() function package main import ( "fmt" "strconv" ) func main() { // Using Atoi() function x := "245" y, e := strconv.Atoi(x) if e == nil { fmt.Printf("%T \n %v", y, y) } } Output:
🌐
Rez Moss
rezmoss.com › blog › basic-conversions-atoi-and-itoa-p1-7
Go String to Int: Complete Atoi & Itoa Guide (With Examples) 1/7 - Rez Moss
August 16, 2025 - Learn Go's strconv.Atoi and Itoa functions with practical examples. Covers error handling, edge cases, and ParseInt for production code.