---
source: https://iinventedlight.com/library/notes/go-types.md
title: "Go types: data types and algorithms for type-checking"
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, go/types; The Go Authors, go/types 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-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). 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-types"
tags: [go, types, type-checker, compiler, packages]
client: Librarian
sources:
  - id: S1
    title: "go/types"
    publisher: The Go Authors
    url: https://pkg.go.dev/go/types
    accessed: 2026-11-26
    license: "BSD-3-Clause"
  - id: S2
    title: "go/types source"
    publisher: The Go Authors
    url: https://go.dev/src/go/types/api.go
    accessed: 2026-11-26
    license: "BSD-3-Clause"
---
# Go types: data types and algorithms for type-checking
**Answer:** The types package declares data types and implements algorithms for type-checking Go packages.

## How to run a check

The Check method on Config invokes the type checker for a package.

A new type checker can also be created and invoked incrementally.

Several interdependent phases make up type-checking.

## What the phases do

Name resolution maps each identifier to the symbol it denotes.

Constant folding computes the exact constant value of every compile-time constant expression.

Type deduction computes the type of every expression and checks language compliance.

## See also

- [go-ast](https://iinventedlight.com/library/notes/go-ast/)
- [go-parser](https://iinventedlight.com/library/notes/go-parser/)
- [go-token](https://iinventedlight.com/library/notes/go-token/)

## Claims

- id: C1
  claim: The package declares data types and implements type-checking algorithms.
  source: S1
  evidence: "Package types declares the data types and implements"

- id: C2
  claim: Name resolution maps each identifier to the symbol it denotes.
  source: S1
  evidence: "Name resolution maps each identifier"

- id: C3
  claim: The package declares data types and implements type-checking algorithms.
  source: S2
  evidence: "Package types declares the data types and implements"

- id: C4
  claim: The Check method on Config invokes the type checker.
  source: S2
  evidence: "to invoke the type checker for a package"

## Sources

- [S1] go/types. The Go Authors. https://pkg.go.dev/go/types . License: BSD-3-Clause. Accessed 2026-11-26.

- [S2] go/types source. The Go Authors. https://go.dev/src/go/types/api.go . License: BSD-3-Clause. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, go/types; The Go Authors, go/types 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).
