You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The header comment of Process implies that the use of the src parameter is optional. However providing a nil value always results in the error:
expected 'package', found 'EOF'
This is because the value is a nil []byte but the go parserParseFile function which is called internally expects src to be of type interface{}. This in turns causes readSource to return nil because the comparison with (interface{}) nil fails.
Either the header comment of Process should be updated or the code modified so that giving a nil src actually works (presumably the intended and better behavior). This requires tweaking the call to ParseFile to cast src to a nilinterface{} if it's a nil []byte.
The text was updated successfully, but these errors were encountered:
Go 1.8
The header comment of
Process
implies that the use of thesrc
parameter is optional. However providing a nil value always results in the error:This is because the value is a nil
[]byte
but the goparser
ParseFile function which is called internally expectssrc
to be of typeinterface{}
. This in turns causes readSource to return nil because the comparison with (interface{}
) nil fails.Either the header comment of
Process
should be updated or the code modified so that giving a nilsrc
actually works (presumably the intended and better behavior). This requires tweaking the call to ParseFile to castsrc
to anil
interface{}
if it's a nil[]byte
.The text was updated successfully, but these errors were encountered: