Help us shape the future of Go! Take the 2026 Go Developer Survey

jqutil

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package jqutil provides shared gojq utilities used by multiple packages.

Index

Constants

This section is empty.

Variables

View Source
var SecureCompileOpts = []gojq.CompilerOption{
	gojq.WithEnvironLoader(func() []string { return nil }),
}

SecureCompileOpts are the gojq compiler options applied to every Compile call in this project. Centralising them here ensures the security intent ($ENV disabled) is never accidentally omitted from a future compile site.

Both internal/config and internal/middleware need identical options. Defining them once in this leaf package removes the duplication and guards against the two copies drifting apart.

Functions

func CompileOptsWithVariables added in v0.4.2

func CompileOptsWithVariables(varNames []string) []gojq.CompilerOption

CompileOptsWithVariables returns a new slice combining SecureCompileOpts with gojq.WithVariables for the given variable names. The returned slice is always a fresh allocation, so callers never mutate the shared SecureCompileOpts backing array.

func ParseErrorDetails added in v0.4.8

func ParseErrorDetails(err error) string

ParseErrorDetails returns a human-readable suffix (e.g. " at offset 3 (token "!")") when err wraps a *gojq.ParseError, or an empty string otherwise. EOF parse failures render the token as "<EOF>" for clearer diagnostics. Centralising the extraction here ensures that config validation and middleware filter compilation cannot diverge in their output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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