You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would like to know how to convert zero prepended integer( i.e octal integer) number from YAML file to YAML Object.
Tried with yaml.v3 also but could see same results.
Hello experts,
Would like to know how to convert zero prepended integer( i.e octal integer) number from YAML file to YAML Object.
Tried with yaml.v3 also but could see same results.
Any help would be appreciates
zero prepended integer examples:
01
001
00002 and so
Sample program
==============
package main
import "fmt"
import "gopkg.in/yaml.v2"
var data =
a: 01 b: 1
func main() {
var obj interface{}
_ = yaml.Unmarshal([]byte(data), &obj)
fmt.Println("YAML data:", data)
fmt.Println("OBJ:", obj)
}_
O/p of above program:
===================
YAML data:
a: 01
b: 1
OBJ: map[a:1 b:1]
The text was updated successfully, but these errors were encountered: