Standard library / io

io.SeekCurrent

Selects the current stream position as seek origin (1). Expected stdout: '2 <nil>\n'.

Formal Syntax & Structure

go syntaxgo
const SeekCurrent = 1

Working Example

Example Snippetgo
package main
import (  "fmt"  "io"  "strings")
func main() {  r := strings.NewReader("abc")  r.ReadByte()  n, e := r.Seek(1, io.SeekCurrent)  fmt.Println(n, e)}
Go Reference