tinycodinglm / lang /lang-0020.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 15)
b27bfb3 verified
|
Raw History Blame Contribute Delete
759 Bytes
opencode trace
System You are an expert software engineer.

You are an expert software engineer.

User

Explain Go's interface system

Assistant

Implicit satisfaction (duck typing). No implements keyword - structural typing.

Interface value: (type, value) pair. nil interface != interface with nil value.

Small interfaces idiomatic: io.Reader, io.Writer. Type assertion x.(Type), type switch. Reflection via reflect.TypeOf/ValueOf.

Generics (1.18+): type constraints via interfaces. type Ordered interface { ~int | ~string }