Socket
Book a DemoInstallSign in
Socket

go.opentelemetry.io/build-tools/checkapi

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go.opentelemetry.io/build-tools/checkapi

v0.26.2
Go
Version published
Created
Source

CheckAPI

CheckAPI is a go tool that parses the AST tree of a Go module, identifying Golang APIs such as structs and functions and enforcing rules against them.

This is particularly useful to reduce the API surface of a Go module to a specific set of functions.

Running CheckAPI

$> checkapi -folder . -config config.yaml

Configuration

The configuration file is in yaml format:

ignored_paths:
  - <exact relative paths of Golang modules to ignore>
allowed_functions:
  - <at least one function match must be present.>
  - name: <name of function>
    parameters: <list of parameters by type>
    return_types: <list of return types>

ignored_functions:
  - <regular expressions of ignored functions. At least one match must be present to ignore the function.>
unkeyed_literal_initialization:
  enabled: <bool>
  limit: <number of fields under which we should prevent unkeyed literal initialization> 

FAQs

Package last updated on 13 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.