MCPcopy Create free account
hub / github.com/nsf/gocode / char_to_byte_offset

Function char_to_byte_offset

utils.go:78–85  ·  view source on GitHub ↗
(s []byte, offset_c int)

Source from the content-addressed store, hash-verified

76}
77
78func char_to_byte_offset(s []byte, offset_c int) (offset_b int) {
79 for offset_b = 0; offset_c > 0 && offset_b < len(s); offset_b++ {
80 if utf8.RuneStart(s[offset_b]) {
81 offset_c--
82 }
83 }
84 return offset_b
85}
86
87func xdg_home_dir() string {
88 xdghome := os.Getenv("XDG_CONFIG_HOME")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected