common

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 6 Imported by: 1 module, 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

Index

Constants

View Source
const (
	WritePermissions = 0600
)

Variables

View Source
var (
	ErrNotFound             = errors.New("Not found")
	ErrMissingRequiredParam = errors.New("Required param missing value")
	ErrMoreChoices          = errors.New("There are additional choices")
	ErrNoSuchModule         = errors.New("Module not found")
	ErrNoSuchCommand        = errors.New("Command not found")
	ErrNoSuchSubCommand     = errors.New("Subcommand not found")
	ErrUnexpectedStatus     = errors.New("Unexpected status code")
)

Functions

func GetJsonString

func GetJsonString(r interface{}) string

func OpenFile

func OpenFile(name string) (*os.File, error)

func ReadFile

func ReadFile(name string) ([]byte, error)

read file and return bytes uses filepath.Clean for gosec error G304

func TryUnmarshalJson

func TryUnmarshalJson(str *string) (*json.RawMessage, error)

check if a given string is valid json if valid, returns raw bytes of unmarshalled json

func WriteFile

func WriteFile(name string, data []byte) error

address gosec write permissions address gosec filename variable warnings

Types

type Input

type Input map[string]interface{}

type Values

type Values map[string]*string

Jump to

Keyboard shortcuts

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