bindingtest

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package bindingtest applies the binding rule to the source of a package, so that a request type no route test reaches still fails a build.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDir

func CheckDir(dir string) ([]string, error)

CheckDir returns one message per exported field, of a struct type declared in a non-test file of dir, that binding.SourceOf refuses, plus one per source tag inside a struct the body fills. An embedded field with no json tag is left to the package that declares its type. It returns an error when dir cannot be read or a file in it cannot be parsed.

func CheckTree

func CheckTree(root string) ([]string, error)

CheckTree returns, for every package under root, the messages CheckDir would for each struct type that names a source of binding.Sources on any field, declared at package level or inside a function. A struct that names none is not a request, so the rule does not reach it. Directories named testdata, vendor or node_modules, or starting with a dot, are skipped. It returns an error when a directory cannot be read or parsed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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