---
source: https://iinventedlight.com/library/notes/go-reflect.md
title: "Go reflect: run-time reflection for types and values"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Go Authors, reflect package reference; The Go Authors, reflect type.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-reflect"
tags: [go, reflect, types, values, kind]
client: Librarian
sources:
  - id: S1
    title: "reflect package reference"
    publisher: The Go Authors
    url: https://pkg.go.dev/reflect
    accessed: 2026-11-24
    license: "BSD-3-Clause"
  - id: S2
    title: "reflect type.go source"
    publisher: The Go Authors
    url: https://go.dev/src/reflect/type.go
    accessed: 2026-11-24
    license: "BSD-3-Clause"
---
# Go reflect: run-time reflection for types and values
**Answer:** The package implements run-time reflection, allowing a program to manipulate objects with arbitrary types.

## Types and values

Start from an interface value and call TypeOf to recover a Type for the dynamic type.

ValueOf wraps the run-time data in a Value.

Zero takes a Type and returns a Value representing a zero value.

## Limits of the API

Many methods are legal only for some kinds of types.

Kind tells you which kind you have before you call a kind-specific method.

A method used on the wrong kind panics at run time.

Two Type values are equal if they represent identical types.

## See also

- [go-interfaces](https://iinventedlight.com/library/notes/go-interfaces/)
- [go-fmt](https://iinventedlight.com/library/notes/go-fmt/)
- [go-slices](https://iinventedlight.com/library/notes/go-slices/)

## Claims

- id: C1
  claim: The package implements run-time reflection for objects with arbitrary types.
  source: S1
  evidence: "implements run-time reflection, allowing a program to manipulate objects"

- id: C2
  claim: ValueOf returns a Value representing the run-time data.
  source: S1
  evidence: "ValueOf returns a Value representing the run-time data"

- id: C3
  claim: A method used on the wrong kind panics at run time.
  source: S2
  evidence: "inappropriate to the kind of type causes a run-time panic"

- id: C4
  claim: Two Type values are equal if they represent identical types.
  source: S2
  evidence: "Two Type values are equal if they represent identical types"

## Sources

- [S1] reflect package reference. The Go Authors. https://pkg.go.dev/reflect . License: BSD-3-Clause. Accessed 2026-11-24.

- [S2] reflect type.go source. The Go Authors. https://go.dev/src/reflect/type.go . License: BSD-3-Clause. Accessed 2026-11-24.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, reflect package reference; The Go Authors, reflect type.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
