Compare commits

..

2 Commits

8 changed files with 29 additions and 18 deletions

View File

@@ -1,11 +1,11 @@
// boolean.go // boolean_test.go
package bocchi package bocchi_test
import "git.sunturtle.xyz/zephyr/errors-my-beloved/boolean/challenge" import "git.sunturtle.xyz/zephyr/errors-my-beloved/boolean/challenge"
var _ = map[bool]struct{}{ var _ = map[bool]struct{}{
false: {}, false: {},
challenge.Flag == "gc25{}": {}, // ERROR: ./boolean.go:7:2: duplicate key false in map literal challenge.Flag == "gc25{}": {}, // ERROR: ./boolean_test.go:7:2: duplicate key false in map literal
} }
var _ = map[bool]struct{}{ var _ = map[bool]struct{}{

View File

@@ -3,5 +3,5 @@
package constraint package constraint
func _() { func _() {
"This package requires cgo to build. An error here means cgo is disabled for your build." "This package requires cgo. An error here means cgo is disabled for your build."
} }

View File

@@ -1,11 +0,0 @@
package main
type Strummer interface {
Strum()
}
type Bocchi struct {
Guitar string
}
var _ Strummer = (*Bocchi)(nil)

3
iface/chord.go Normal file
View File

@@ -0,0 +1,3 @@
package main
type Chord string

13
iface/guitarist.go Normal file
View File

@@ -0,0 +1,13 @@
package main
type Guitarist interface {
Strum(chord Chord)
}
type Bocchi struct {
Guitar string
}
func (b *Bocchi) Strum(chord string) {}
var _ Guitarist = (*Bocchi)(nil)

View File

@@ -1,7 +1,7 @@
//go:build ignore //go:build ignore
// step1.go // step1.go
package bocchi package main
import "unsafe" import "unsafe"
@@ -11,3 +11,5 @@ type Bocchi struct {
} }
var _ [0]struct{} = [unsafe.Sizeof(Bocchi{}) - 0]struct{}{} var _ [0]struct{} = [unsafe.Sizeof(Bocchi{}) - 0]struct{}{}
func main() {}

View File

@@ -1,7 +1,7 @@
//go:build ignore //go:build ignore
// step2.go // step2.go
package bocchi package main
import "unsafe" import "unsafe"
@@ -11,3 +11,5 @@ type Bocchi struct {
} }
var _ [0]struct{} = [unsafe.Sizeof(Bocchi{}) - 16]struct{}{} var _ [0]struct{} = [unsafe.Sizeof(Bocchi{}) - 16]struct{}{}
func main() {}

View File

@@ -1,4 +1,4 @@
package bocchi package main
import "unsafe" import "unsafe"
@@ -16,3 +16,5 @@ var (
// assert y is the last field in Bocchi // assert y is the last field in Bocchi
_ [0]struct{} = [unsafe.Sizeof(Bocchi{}) - (unsafe.Alignof(Bocchi{}.y) + unsafe.Sizeof(Bocchi{}.y))]struct{}{} _ [0]struct{} = [unsafe.Sizeof(Bocchi{}) - (unsafe.Alignof(Bocchi{}.y) + unsafe.Sizeof(Bocchi{}.y))]struct{}{}
) )
func main() {}