var ErrNoEmbed … var errStopWalk … // embedDefinition finds a file matching the embed directive at pos in the mapped file. // If there is no embed directive at pos, returns ErrNoEmbed. // If multiple files match the embed pattern, one is picked at random. func embedDefinition(m *protocol.Mapper, pos protocol.Position) ([]protocol.Location, error) { … } // parseEmbedDirective attempts to parse a go:embed directive argument at pos. // If successful it return the directive argument and its range, else zero values are returned. func parseEmbedDirective(m *protocol.Mapper, pos protocol.Position) (string, protocol.Range) { … } type fileEmbed … // parseGoEmbed patterns that come after the directive. // // Copied and adapted from go/build/read.go. // Replaced token.Position with start/end offset (including quotes if present). func parseGoEmbed(args string, offset int) ([]fileEmbed, error) { … }