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 385 views
1 answer 294 views
1 answer 247 views
1 answer 379 views
1 answer 326 views
3 answers 565 views
565 views asked Oct 19, 2021 by avibootz
...