- Service binding via reflection with 4 method signatures - Dependency injection (Wired/auto tags) and guards - Streamable HTTP (NDJSON) streaming responses - Go/TypeScript client code generation (self-contained, with interceptors) - Enum support, structured Result, logging - 16 regression tests covering all fixed bugs
26 lines
419 B
Go
26 lines
419 B
Go
// 文本处理辅助方法
|
|
|
|
package fun
|
|
|
|
import "unicode"
|
|
|
|
// 首字母转大写
|
|
func firstLetterToUpper(s string) string {
|
|
if len(s) == 0 {
|
|
return s
|
|
}
|
|
runes := []rune(s)
|
|
runes[0] = unicode.ToUpper(runes[0])
|
|
return string(runes)
|
|
}
|
|
|
|
// 首字母转小写
|
|
func firstLetterToLower(s string) string {
|
|
if len(s) == 0 {
|
|
return s
|
|
}
|
|
runes := []rune(s)
|
|
runes[0] = unicode.ToLower(runes[0])
|
|
return string(runes)
|
|
}
|