util

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolValue

func BoolValue(value interface{}) (bool, error)

BoolValue 将 interface{} 转换为 bool

func ClampInt

func ClampInt(value, minValue, maxValue int) int

ClampInt 将值限制在 min 和 max 之间

func CombineOutput

func CombineOutput(stdout string, stderr string) string

CombineOutput 合并 stdout 和 stderr,优先返回 stdout

func CountContentLines

func CountContentLines(content string) int

CountContentLines 计算内容的行数

func IntValue

func IntValue(value interface{}) (int, error)

IntValue 将 interface{} 转换为 int,支持多种数值类型

func StringValue

func StringValue(input map[string]interface{}, key string) string

StringValue 从 map 中获取字符串值并去除首尾空格

func TruncateOutput

func TruncateOutput(output string, maxLines int) (string, bool, int)

TruncateOutput 截断输出,超过最大行数时只显示最后部分

Types

This section is empty.

Jump to

Keyboard shortcuts

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