Skip to content

Commit

Permalink
interp: improve method signature, and add godoc links
Browse files Browse the repository at this point in the history
this is a zero code changes. The signature was already the right one.
We are just using an alias, that will make things clearer.
  • Loading branch information
ccoVeille committed Jan 2, 2025
1 parent a56e337 commit 8da41f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions interp/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -900,9 +900,9 @@ func (r *Runner) builtinCode(ctx context.Context, pos syntax.Pos, name string, a
return 0
}

// mapfileSplit returns a suitable Split function for a [bufio.Scanner];
// mapfileSplit returns a function that satisfies [bufio.SplitFunc] interface, [bufio.Scanner] will use it to split;
// the code is mostly stolen from [bufio.ScanLines].
func mapfileSplit(delim byte, dropDelim bool) func(data []byte, atEOF bool) (advance int, token []byte, err error) {
func mapfileSplit(delim byte, dropDelim bool) bufio.SplitFunc {
return func(data []byte, atEOF bool) (advance int, token []byte, err error) {
if atEOF && len(data) == 0 {
return 0, nil, nil
Expand Down

0 comments on commit 8da41f0

Please sign in to comment.