GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — exe.dev/completeinit at main · boldsoftware/exe.dev

Expand file tree

/

completeinit

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

completeinit

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
cmd/completeinit
cmd/completeinit
 
 
testdata/src
testdata/src
 
 
README.md
README.md
 
 
analyzer.go
analyzer.go
 
 
analyzer_test.go
analyzer_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

README.md

Outline

This is entirely vibe-coded. We use it and it works for us. YMMV, no guarantees.

Discussed at https://commaok.xyz/ai/vibed-static-analysis/

The remainder of this README is generated by an LLM.


completeinit

A Go linter that ensures structs are fully initialized. Mark a struct with //exe:completeinit and the linter will report any composite literal that omits a field or uses positional (unkeyed) syntax.

Works across packages using go/analysis facts—if an imported type is marked, callers get checked too.

Install

go install github.com/boldsoftware/exe.dev/completeinit/cmd/completeinit@latest

Usage

go vet -vettool=$(which completeinit) ./...

Example

//exe:completeinit
type Config struct {
    Host string
    Port int
}

_ = Config{Host: "localhost"} // error: missing field Port
_ = Config{"localhost", 80}   // error: must use keyed fields

For exported types, only exported fields are enforced (unexported fields can't be set from other packages). For unexported types, all fields are enforced.

Marker placement

The //exe:completeinit comment can appear:

  • Before the type declaration
  • On the TypeSpec line (in grouped type (...) blocks)
  • As an end-of-line comment on the type declaration
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.