Standard library / io
io.SeekEnd
Selects the stream end as seek origin (2); negative displacement seeks backward. Expected stdout: '2 <nil>\n'.
Formal Syntax & Structure
go syntaxgo
const SeekEnd = 2Working Example
Example Snippetgo
package main
import ( "fmt" "io" "strings")
func main() { r := strings.NewReader("abc"); n, e := r.Seek(-1, io.SeekEnd); fmt.Println(n, e) }