golang / go

The Go programming language

Home Page:https://go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fmt: index out of range (4)

dvyukov opened this issue · comments

The following program crashes with a panic.

package main

import "fmt"

func main() {
    fmt.Printf("%+.65", 0)
}
panic: runtime error: index out of range

goroutine 1 [running]:
fmt.(*fmt).integer(0x2082322c8, 0x0, 0xa, 0xbfe01, 0x1199b0, 0x10)
        src/fmt/format.go:275 +0x532
fmt.(*pp).fmtInt64(0x208232270, 0x0, 0x200000076)
        src/fmt/print.go:363 +0x15d
fmt.(*pp).printArg(0x208232270, 0xbfea0, 0x2081ee390, 0x76, 0x0, 0x2081f2000)
        src/fmt/print.go:770 +0xe56
fmt.(*pp).doPrintf(0x208232270, 0x105700, 0x5, 0x208221f60, 0x1, 0x1)
        src/fmt/print.go:1211 +0x8f3
fmt.Fprintf(0x220839a1c0, 0x20820e010, 0x105700, 0x5, 0x208221f60, 0x1, 0x1, 0xc283, 0x0, 0x0)
        src/fmt/print.go:188 +0x77
fmt.Printf(0x105700, 0x5, 0x208221f60, 0x1, 0x1, 0x2082000b8, 0x0, 0x0)
        src/fmt/print.go:197 +0x97
main.main()
        tmp.go:6 +0xe1

on commit c8b31c5