conventions.io

Tech Challenge

2026-11-23

🦫

Daily Tech Challenge

Go

medium
Question 1 of 5

What does this Go program print, given what strings.CutPrefix returns when the prefix is absent (Go 1.20+)?

Example
package main

import (
	"fmt"
	"strings"
)

func main() {
	a, ok1 := strings.CutPrefix("go1.22", "go")
	b, ok2 := strings.CutPrefix("go1.22", "rs")
	fmt.Println(a, ok1, b, ok2)
}

Monday, November 23, 2026 · A new challenge drops every day