Standard library / go/token
go/token.FileSet.Base()
Returns the next minimum file base. Expected stdout: '7\n'.
Formal Syntax & Structure
go syntaxgo
func (s *FileSet) Base() intReturn Value
int
Returns the next minimum file base.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/token")
func main() { s := token.NewFileSet() f := s.AddFile("demo.go", -1, 5) f.SetLinesForContent([]byte("ab\ncd")) fmt.Println(s.Base())}