
-- flags --
-ignore_extra_diags

-- go.mod --
module mod.test

go 1.18

-- foo/foo.go --
package foo

type StructFoo struct{ F int }

-- a.go --
package a

import "mod.test/foo"

func _() {
	StructFoo{} //@item(litStructFoo, "StructFoo{}", "struct{...}", "struct")

	var sfp *foo.StructFoo
	// Don't insert the "&" before "StructFoo{}".
	sfp = foo.Str //@snippet(re"() \\/\\/", litStructFoo, "StructFoo{$0\\}")

	var sf foo.StructFoo
	sf = foo.Str //@snippet(re"() \\/\\/", litStructFoo, "StructFoo{$0\\}")
	sf = foo. //@snippet(re"() \\/\\/", litStructFoo, "StructFoo{$0\\}")
}

-- http.go --
package a

import (
	"net/http"
	"sort"
)

func _() {
	sort.Slice(nil, fun) //@snippet(re"()\\)", litFunc, "func(i, j int) bool {$0\\}")

	http.HandleFunc("", f) //@snippet(re"()\\)", litFunc, "func(w http.ResponseWriter, r *http.Request) {$0\\}")

	//@item(litFunc, "func(...) {}", "", "var")
	http.HandlerFunc() //@item(handlerFunc, "http.HandlerFunc()", "", "var")
	http.Handle("", http.HandlerFunc()) //@snippet(re"()\\)\\)", litFunc, "func(w http.ResponseWriter, r *http.Request) {$0\\}")
	http.Handle("", h) //@snippet(re"()\\)", handlerFunc, "http.HandlerFunc($0)")
}
