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 387 views
1 answer 295 views
1 answer 248 views
1 answer 381 views
1 answer 328 views
3 answers 568 views
568 views asked Oct 19, 2021 by avibootz
...