Mageia Bugzilla – Attachment 8444 Details for
Bug 19102
golang new security issue CVE-2016-5386
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Text analyzer of sorts, written in go
dup1.go (text/x-go), 587 bytes, created by
Len Lawrence
on 2016-09-23 22:26:48 CEST
(
hide
)
Description:
Text analyzer of sorts, written in go
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2016-09-23 22:26:48 CEST
Size:
587 bytes
patch
obsolete
>// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan. >// License: https://creativecommons.org/licenses/by-nc-sa/4.0/ > >// See page 8. >//!+ > >// Dup1 prints the text of each line that appears more than >// once in the standard input, preceded by its count. >package main > >import ( > "bufio" > "fmt" > "os" >) > >func main() { > counts := make(map[string]int) > input := bufio.NewScanner(os.Stdin) > for input.Scan() { > counts[input.Text()]++ > } > // NOTE: ignoring potential errors from input.Err() > for line, n := range counts { > if n > 1 { > fmt.Printf("%d\t%s\n", n, line) > } > } >} > >//!-
// Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan. // License: https://creativecommons.org/licenses/by-nc-sa/4.0/ // See page 8. //!+ // Dup1 prints the text of each line that appears more than // once in the standard input, preceded by its count. package main import ( "bufio" "fmt" "os" ) func main() { counts := make(map[string]int) input := bufio.NewScanner(os.Stdin) for input.Scan() { counts[input.Text()]++ } // NOTE: ignoring potential errors from input.Err() for line, n := range counts { if n > 1 { fmt.Printf("%d\t%s\n", n, line) } } } //!-
View Attachment As Raw
Actions:
View
Attachments on
bug 19102
:
8440
| 8444 |
8445
|
8489