type Source … type sourceImpl … var _ … // NewTextSource creates a new Source from the input text string. func NewTextSource(text string) Source { … } // NewStringSource creates a new Source from the given contents and description. func NewStringSource(contents string, description string) Source { … } // NewInfoSource creates a new Source from a SourceInfo. func NewInfoSource(info *exprpb.SourceInfo) Source { … } // Content implements the Source interface method. func (s *sourceImpl) Content() string { … } // Description implements the Source interface method. func (s *sourceImpl) Description() string { … } // LineOffsets implements the Source interface method. func (s *sourceImpl) LineOffsets() []int32 { … } // LocationOffset implements the Source interface method. func (s *sourceImpl) LocationOffset(location Location) (int32, bool) { … } // NewLocation implements the Source interface method. func (s *sourceImpl) NewLocation(line, col int) Location { … } // OffsetLocation implements the Source interface method. func (s *sourceImpl) OffsetLocation(offset int32) (Location, bool) { … } // Snippet implements the Source interface method. func (s *sourceImpl) Snippet(line int) (string, bool) { … } // findLineOffset returns the offset where the (1-indexed) line begins, // or false if line doesn't exist. func (s *sourceImpl) findLineOffset(line int) (int32, bool) { … } // findLine finds the line that contains the given character offset and // returns the line number and offset of the beginning of that line. // Note that the last line is treated as if it contains all offsets // beyond the end of the actual source. func (s *sourceImpl) findLine(characterOffset int32) (int32, int32) { … }