Repository: goccy/go-yaml (go)

Issue:
go-yaml v1.13.7 and go-yaml v1.13.8 parse error
**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**

Please provide a minimum yaml content that can be reproduced.
We are more than happy to use [Go Playground](https://go.dev/play/p/cG_sFccgqTk )

```
package main

import (
	"fmt"

	"github.com/goccy/go-yaml"
)

func main() {
	yamlC := `helmfiles:
  - path: subhelmfile.yaml.gotmpl
    selectorsInherited: true
    values:
    - specificValues:
        
        myContainers:
        - command:
          - /bin/sh
          - -c
          - env
          image: registry.k8s.io/busybox
          name: test-container
        
`
	target := make(map[string]any)

	err := yaml.Unmarshal([]byte(yamlC), &target)
	if err != nil {
		fmt.Printf("%v", err)
	} else {
		fmt.Print("ok")
	}
}

```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version Variables**
 - Go version: 1.23
 - go-yaml's Version: 1.13.8

**Additional context**
Add any other context about the problem here.


Pull request description:
Fix removeFromRightSpace process at scanner
fix #528 

Patch:
diff --git a/scanner/context.go b/scanner/context.go
index f6c06e1..7c5517d 100644
--- a/scanner/context.go
+++ b/scanner/context.go
@@ -198,7 +198,7 @@ func (c *Context) addOriginBuf(r rune) {
 	}
 }
 
-func (c *Context) removeRightSpaceFromBuf() int {
+func (c *Context) removeRightSpaceFromBuf() {
 	trimmedBuf := c.obuf[:c.notSpaceOrgCharPos]
 	buflen := len(trimmedBuf)
 	diff := len(c.obuf) - buflen
@@ -206,7 +206,6 @@ func (c *Context) removeRightSpaceFromBuf() int {
 		c.obuf = c.obuf[:buflen]
 		c.buf = c.bufferedSrc()
 	}
-	return diff
 }
 
 func (c *Context) isDocument() bool {
diff --git a/scanner/scanner.go b/scanner/scanner.go
index 50e24b1..f1d2774 100644
--- a/scanner/scanner.go
+++ b/scanner/scanner.go
@@ -623,14 +623,7 @@ func (s *Scanner) scanNewLine(ctx *Context, c rune) {
 	// ---
 	// a:[space][space]
 	//   b: c
-	removedNum := ctx.removeRightSpaceFromBuf()
-	if removedNum > 0 {
-		s.column -= removedNum
-		s.offset -= removedNum
-		if s.savedPos != nil {
-			s.savedPos.Column -= removedNum
-		}
-	}
+	ctx.removeRightSpaceFromBuf()
 
 	// There is no problem that we ignore CR which followed by LF and normalize it to LF, because of following YAML1.2 spec.
 	// > Line breaks inside scalar content must be normalized by the YAML processor. Each such line break must be parsed into a single line feed character.


Test patch:
diff --git a/parser/parser_test.go b/parser/parser_test.go
index f9218b7..6bb8568 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -128,6 +128,11 @@ a: !tag
 a: !tag
   b: c
   d: e
+`,
+		`
+a:
+  b: c
+     
 `,
 	}
 	for _, src := range sources {