What does it mean - %d...?

If I’ve got a single id value, then what does it mean if the following code uses three dots after %d?

fmt.Fprintf(w, "a book with id=%d...", id)
1 Like

They are just three dots. Try it:

package main

import (
	"fmt"
)

func main() {
	id := 1
	fmt.Printf("a book with id=%d...", id)
}

Output:

a book with id=1…

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.