OneBug This week's bugs
Spot the bug Go
1
package main
2
 
3
import (
4
	"fmt"
5
	"time"
6
)
7
 
8
// Print the invoice dates for the header block.
9
func main() {
10
	issued := time.Date(2026, time.August, 6, 15, 4, 5, 0, time.UTC)
11
	due := issued.AddDate(0, 0, 14)
12
	fmt.Println("issued:", issued.Format("YYYY-MM-DD"))
13
	fmt.Println("due:", due.Format("2006-01-02"))
14
	// expected: issued: 2026-08-06  due: 2026-08-20
15
	// actual:   issued: YYYY-MM-DD  due: 2026-08-20  (!)
16
}

Read the full write-up for this bug (spoilers)