MCPcopy Create free account
hub / github.com/dropbox/dbxcli / insertMetadataSection

Function insertMetadataSection

tools/gen-docs/main.go:123–136  ·  view source on GitHub ↗
(contents []byte, section []byte)

Source from the content-addressed store, hash-verified

121}
122
123func insertMetadataSection(contents []byte, section []byte) []byte {
124 marker := []byte("\n### SEE ALSO\n\n")
125 index := bytes.Index(contents, marker)
126 if index == -1 {
127 return append(append(contents, '\n'), section...)
128 }
129
130 result := make([]byte, 0, len(contents)+len(section)+1)
131 result = append(result, contents[:index]...)
132 result = append(result, '\n')
133 result = append(result, section...)
134 result = append(result, contents[index:]...)
135 return result
136}
137
138func commandMetadataSection(command *cobra.Command) []byte {
139 manifest := cmd.CommandManifestFor(command)

Callers 1

addCommandMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected