Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

go.opentelemetry.io/build-tools/gotmpl

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go.opentelemetry.io/build-tools/gotmpl

  • v0.15.0
  • Go
  • Socket score

Version published
Created
Source

gotmpl

gotmpl is a tool to generate files from templates and JSON data.

Usage

Usage of gotmpl:
  -b, --body string   Template body filepath.
  -d, --data string   Data in JSON format.
  -o, --out string    Output filepath.

Background

gotmpl has been created as one of the solutions to avoid depending on internal packages of different modules. Such dependencies could transitively lead to build failure when an internal package API introduces a non-backward compatible change.

gotmpl can be used for sharing non-exported common code across multiple Go modules. It is advised to keep the shared code in a separate internal Go module (e.g. under internal/shared). The shared code should be consumed across modules using go generate, for example:

//go:generate gotmpl --body=../internal/shared/env.go.tmpl "--data={ \"pkg\": \"jaeger\" }" --out=env.go

FAQs

Package last updated on 07 Nov 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc