From b3d96ede031d996cf5f2004549a0c1804a4556f9 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:13:45 +0100 Subject: [PATCH] interp: improve method signature, and add godoc links this is a zero code changes. The signature was already the right one. We are just using an alias, that will make things clearer. --- interp/builtin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interp/builtin.go b/interp/builtin.go index fcfcea94..e647c97d 100644 --- a/interp/builtin.go +++ b/interp/builtin.go @@ -902,9 +902,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