MCPcopy
hub / github.com/XiaoMi/Gaea / WriteKeyWord

Method WriteKeyWord

parser/format/format.go:300–308  ·  view source on GitHub ↗

WriteKeyWord writes the `keyWord` into writer. `keyWord` will be converted format(uppercase and lowercase for now) according to `RestoreFlags`.

(keyWord string)

Source from the content-addressed store, hash-verified

298// WriteKeyWord writes the `keyWord` into writer.
299// `keyWord` will be converted format(uppercase and lowercase for now) according to `RestoreFlags`.
300func (ctx *RestoreCtx) WriteKeyWord(keyWord string) {
301 switch {
302 case ctx.Flags.HasKeyWordUppercaseFlag():
303 keyWord = strings.ToUpper(keyWord)
304 case ctx.Flags.HasKeyWordLowercaseFlag():
305 keyWord = strings.ToLower(keyWord)
306 }
307 fmt.Fprint(ctx.In, keyWord)
308}
309
310// WriteString writes the string into writer
311// `str` may be wrapped in quotes and escaped according to RestoreFlags.

Callers 15

TestRestoreCtxFunction · 0.95
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80
RestoreMethod · 0.80

Calls 2

Tested by 1

TestRestoreCtxFunction · 0.76