How to convert int to octal string in Go

1 Answer

0 votes
package main
 
import (
    "fmt"
    "strconv"
)
 
func main() {
    i := 255
    s := strconv.FormatInt(int64(i) , 8)

    fmt.Printf("Type : %T \nValue : %v\n", s, s) 
}
 
 
 
 
/*
run:
 
Type : string 
Value : 377
 
*/

 



answered May 26, 2020 by avibootz

Related questions

1 answer 277 views
1 answer 190 views
1 answer 154 views
1 answer 261 views
1 answer 233 views
3 answers 422 views
422 views asked Oct 19, 2021 by avibootz
...