dce

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package dce implements dead code elimination for generated Go source files. It removes top-level declarations from the runtime section that are not reachable from non-runtime code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EliminateDeadCode

func EliminateDeadCode(src string) (string, error)

EliminateDeadCode parses a generated Go source file, identifies runtime declarations (between the oapi-runtime markers), and removes any that are not reachable from non-runtime code.

The output is re-printed via go/printer, so callers should run goimports afterward to normalize formatting.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL