Versions in this module Expand all Collapse all v1 v1.0.0 Feb 7, 2026 Changes in this version + type SourceCode struct + Lines []string + func Parse(content any) (sc *SourceCode) + func ReadFS(fileSys fs.FS, fileName string) (sc *SourceCode, err error) + func ReadFile(fileName string) (sc *SourceCode, err error) + func (sc *SourceCode) AddConst(constDefinition string) + func (sc *SourceCode) AddImport(importDefinition string) + func (sc *SourceCode) AddVar(varDefinition string) + func (sc *SourceCode) Append(content any) + func (sc *SourceCode) AppendSpacer() + func (sc *SourceCode) Block(baseLine int) (comment *SourceCode, body *SourceCode) + func (sc *SourceCode) Content() string + func (sc *SourceCode) CopyrightNotice() (notice *SourceCode) + func (sc *SourceCode) Indentation(line int) string + func (sc *SourceCode) InsertAfter(line int, content any) + func (sc *SourceCode) InsertBefore(line int, content any) + func (sc *SourceCode) Len() (lines int) + func (sc *SourceCode) MatchAllLines(regularExpression string) (matchedLines []int) + func (sc *SourceCode) MatchFirstLine(regularExpression string) (matchedLine int) + func (sc *SourceCode) MatchNextLine(onOrAfterLine int, regularExpression string) (matchedLine int) + func (sc *SourceCode) MatchPreviousLine(onOrBeforeLine int, regularExpression string) (matchedLine int) + func (sc *SourceCode) Remove(lineStart int, lineEnd int) + func (sc *SourceCode) Replace(lineStart int, lineEnd int, newContent any) + func (sc *SourceCode) ReplaceAllMatches(regularExpression string, replacement string) + func (sc *SourceCode) SortImports() + func (sc *SourceCode) Sub(lineStart int, lineEnd int) (sub *SourceCode) + func (sc *SourceCode) WriteToFile(destFileName string) (written bool, err error)