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

textutil

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package textutil 是 core strutil 的转发层:文本/路径安全化、CSV 与小工具 的唯一实现在 git-ferry-core/pkg/strutil,本包只保留包名以稳定调用方 import。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolFact

func BoolFact(b bool) string

BoolFact bool → "true"/"false"(健康评分 facts 用)。

func CSVEscape

func CSVEscape(s string) string

CSVEscape 转义 CSV 单元格(含逗号/引号/换行时加引号)。

func Itoa

func Itoa(n int) string

Itoa int 转字符串(统一入口)。

func Itoa64

func Itoa64(n int64) string

Itoa64 int64 转字符串。

func SanitizeFileToken

func SanitizeFileToken(s string) string

SanitizeFileToken 文件名安全化(路径分隔符/穿越防护)。

func SanitizePathToken

func SanitizePathToken(s string) string

SanitizePathToken 路径段安全化:去掉 / \ .. 与空格,防路径穿越。

func Truncate

func Truncate(s string, n int) string

Truncate 按字节截断并追加省略号(保证 UTF-8 边界)。

func TruncateRunes

func TruncateRunes(s string, n int) string

TruncateRunes 按字符(rune)截断。

Types

This section is empty.

Jump to

Keyboard shortcuts

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