Repository: goccy/go-yaml (go)

Issue:
bug on inline array reading 
https://play.golang.org/p/l3cZy3n9T62

```
package main

import (
	"fmt"
	"github.com/goccy/go-yaml"
	y "gopkg.in/yaml.v2"
)

func main() {
	yml := `
- a: [2 , 2] 			
  b: [2 , 2] 			
  c: [2 , 2]`
	var d interface{}
	yaml.Unmarshal([]byte(yml), &d)
	fmt.Printf("%v\n%v\n", yml, d)
	y.Unmarshal([]byte(yml), &d)
	fmt.Printf("%v\n%v\n", yml, d)
}
- a: [2 , 2] 			
  b: [2 , 2] 			
  c: [2 , 2]
[map[a:[2 2]]]

- a: [2 , 2] 			
  b: [2 , 2] 			
  c: [2 , 2]
[map[a:[2 2] b:[2 2] c:[2 2]]]
```

Pull request description:
Fix handling of tab characters as unnecessary character
fix #128 


Patch:
diff --git a/scanner/context.go b/scanner/context.go
index 32fceb9..e629a5c 100644
--- a/scanner/context.go
+++ b/scanner/context.go
@@ -88,14 +88,14 @@ func (c *Context) addBuf(r rune) {
 		return
 	}
 	c.buf = append(c.buf, r)
-	if r != ' ' {
+	if r != ' ' && r != '\t' {
 		c.notSpaceCharPos = len(c.buf)
 	}
 }
 
 func (c *Context) addOriginBuf(r rune) {
 	c.obuf = append(c.obuf, r)
-	if r != ' ' {
+	if r != ' ' && r != '\t' {
 		c.notSpaceOrgCharPos = len(c.obuf)
 	}
 }
diff --git a/scanner/scanner.go b/scanner/scanner.go
index d92c23c..2ab8980 100644
--- a/scanner/scanner.go
+++ b/scanner/scanner.go
@@ -360,7 +360,7 @@ func (s *Scanner) scanLiteral(ctx *Context, c rune) {
 func (s *Scanner) scanLiteralHeader(ctx *Context) (pos int, err error) {
 	header := ctx.currentChar()
 	ctx.addOriginBuf(header)
-	ctx.progress(1) // skip '|' or '<' character
+	ctx.progress(1) // skip '|' or '>' character
 	for idx, c := range ctx.src[ctx.idx:] {
 		pos = idx
 		ctx.addOriginBuf(c)


Test patch:
diff --git a/decode_test.go b/decode_test.go
index 530c827..1e0f246 100644
--- a/decode_test.go
+++ b/decode_test.go
@@ -2048,3 +2048,20 @@ func TestDecoder_LiteralWithNewLine(t *testing.T) {
 		}
 	}
 }
+
+func TestDecoder_TabCharacterAtRight(t *testing.T) {
+	yml := `
+- a: [2 , 2] 			
+  b: [2 , 2] 			
+  c: [2 , 2]`
+	var v []map[string][]int
+	if err := yaml.Unmarshal([]byte(yml), &v); err != nil {
+		t.Fatal(err)
+	}
+	if len(v) != 1 {
+		t.Fatalf("failed to unmarshal %+v", v)
+	}
+	if len(v[0]) != 3 {
+		t.Fatalf("failed to unmarshal %+v", v)
+	}
+}