>
> Thank you for your message. 

I tried to exec with  back-quoted string and check git hash number again.

The code which I ran is
package main

import (
"fmt"

yaml "gopkg.in/yaml.v2"
)

type Sample struct {
Namespace   string `yaml:"namespace"`
Name        string `yaml:"name"`
Description string `yaml:"description"`
Format      struct {
Type string `yaml:"type"`
File string `yaml:"file"`
} `yaml:"format"`
}

const invalidYaml = `
 namespace: aaaa
name: bbb
description: ccccc
format::
  type: sample
file: foo.sh
`

func main() {
fmt.Println(invalidYaml)
sample := &Sample{}
err := yaml.Unmarshal([]byte(invalidYaml), sample)
fmt.Printf("%v\n", err)
}

The result in mac is here
% sw_vers; go version; git log --oneline -1; go run main.go                
                                                                            
(git)-[master]
ProductName:    Mac OS X
ProductVersion: 10.12.6
BuildVersion:   16G1036
go version go1.10 darwin/amd64
201773b (HEAD -> master, origin/master, origin/HEAD) add line break

 namespace: aaaa
name: bbb
description: ccccc
format::
  type: sample
file: foo.sh

yaml: line 2: did not find expected <document start>

The result in linux is here
cat /proc/version; go version; git log --oneline -1; go run main.go
Linux version 3.10.0-693.11.6.el7.x86_64 (buil...@kbuilder.dev.centos.org) 
(gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Thu Jan 4 
01:06:37 UTC 2018
go version go1.10 linux/amd64
201773b add line break

 namespace: aaaa
name: bbb
description: ccccc
format::
  type: sample
file: foo.sh

<nil>

Am I answer collect?

Thank you.
Yuichi

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to