MCPcopy Index your code
hub / github.com/bitfield/script / ExamplePipe_Freq

Function ExamplePipe_Freq

script_test.go:2397–2425  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2395}
2396
2397func ExamplePipe_Freq() {
2398 input := strings.Join([]string{
2399 "apple",
2400 "orange",
2401 "banana",
2402 "banana",
2403 "apple",
2404 "orange",
2405 "kumquat",
2406 "apple",
2407 "orange",
2408 "apple",
2409 "banana",
2410 "banana",
2411 "apple",
2412 "apple",
2413 "orange",
2414 "apple",
2415 "apple",
2416 "apple",
2417 "apple",
2418 }, "\n")
2419 script.Echo(input).Freq().Stdout()
2420 // Output:
2421 // 10 apple
2422 // 4 banana
2423 // 4 orange
2424 // 1 kumquat
2425}
2426
2427func ExamplePipe_Get() {
2428 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
JoinMethod · 0.80
StdoutMethod · 0.80
FreqMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…