package strings
import "github.com/open-policy-agent/opa/internal/strings"
Package strings contains helpers to perform string manipulation
Index ¶
- func Truncate(str string, maxWidth int) string
- func TruncateFilePaths(maxIdealWidth, maxWidth int, path ...string) (map[string]string, int)
Functions ¶
func Truncate ¶
func TruncateFilePaths ¶
TruncateFilePaths truncates the given file paths to conform to the given "ideal" width and returns the shortened paths by replacing the middle parts of paths with "...", ex: bundle1/.../a/b/policy.rego
Source Files ¶
- Version
- v1.4.2 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 6 hours ago –
Tools for package owners.