postprocess

command
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command postprocess applies transformations to generated.go to fix conflicts introduced by oapi-codegen that cannot be resolved via configuration alone.

Transformations applied:

  1. Rename symbols that conflict with the public API of this package (ClientOption, NewClient, WithHTTPClient, WithBaseURL, PrometheusRule, the PrometheusResultType "string" enum value which oapi-codegen names String and would clash with the hand-written String helper, and the unversioned team CRD types TeamDefinition and TeamDefinitionKind which are stabilised as TeamDefinitionV1Alpha1 and TeamDefinitionV1Alpha1Kind to keep the CRD envelope's API-version suffix in the public surface). oapi-codegen does not provide a configuration option to rename these. Selector members (e.g. url.URL.String()) are left untouched so the rename never rewrites a method or field access on a different type.
  2. Remove deprecated fields from PrometheusAlertRule (Description, Summary, and the deprecated KeepFiringFor) since these have been replaced by annotations and the snake_case keep_firing_for field respectively.
  3. Strip YAML handling (the gopkg.in/yaml.v2 import, response struct fields named YAML*, and switch cases that call yaml.Unmarshal). The root package must not depend on any YAML library; YAML support belongs in the yaml/ subpackage, and the TestNoYAMLDependency guard test enforces this.

Usage: go run ./tools/postprocess generated.go

Jump to

Keyboard shortcuts

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