23 ms·
I wonder, what's the "weirdest" expression in Go? Here's one: type Foo struct{} func (Foo) Bar() { println("weird...") } func main() { ([...]func(
by nemo1618 1y ago
I wonder, what's the "weirdest" expression in Go? Here's one:
type Foo struct{}
func (Foo) Bar() { println("weird...") }
func main() {
([...]func(){^^len(`
`): (&Foo{}).Bar})[cap(append([]any(nil),1,2,3))]()
}
- assbuttbuttass 1y agoMakes sense to me, [...]func() is an array of functions, and [...]T{index: value} is uncommon but still perfectly comprehensible
- nikolayasdf123 1y agothis the worst? not too bad. fairly comprehensible.
- yencabulator 1y agoI have a personal fondness for silly variations of type __ *[]*__