MCPcopy Index your code
hub / github.com/semaphoreui/semaphore / truncateCommitMessage

Function truncateCommitMessage

db_lib/commit_message.go:7–13  ·  view source on GitHub ↗

Slice by runes — byte slicing can split a multi-byte UTF-8 sequence.

(msg string)

Source from the content-addressed store, hash-verified

5
6// Slice by runes — byte slicing can split a multi-byte UTF-8 sequence.
7func truncateCommitMessage(msg string) string {
8 runes := []rune(msg)
9 if len(runes) > commitMessageMaxRunes {
10 return string(runes[:commitMessageMaxRunes])
11 }
12 return msg
13}

Calls

no outgoing calls