This is a creation in Article, where the information may have evolved or changed.
Package Mainimport ("Encoding/csv" "FMT" "IO" "OS" "Path/filepath" "StrConv") Func Checkerr (err error) {if nil! = Err {Panic ( ERR)}}func GetFullPath (path String) string {Absolutepath, _: = FilePath. Abs (path) return Absolutepath}func WriteFile (content []string) {f, err: = OS. OpenFile ("Samename.csv", OS. O_append|os. O_create, OS. Modeappend) Checkerr (ERR) defer f.close () f.writestring ("\XEF\XBB\XBF") Writer: = csv. Newwriter (f) writer. Write (content) writer. Flush ()}var exsit []string = []string{}func exsit (name string) bool {size: = Len (exsit) for I: = 0; i < size; i++ {if ex Sit[i] = = name {return True}}return false}func findsame (path string) {fullPath: = GetFullPath (path) records: = Getstrings (f Ullpath) Size: = Len (records) for I: = 0; i < size; i++ {rec: = records[i]recnodate: = Rec[:len (rec) -19]flag: = 1for I2: = i + 1; i2 < size; i2++ {if recnodate = records[ I2][:len (Records[i2]) -19] &&! Exsit (recnodate) {WriteFile ([]string{strconv. ITOA (flag), Records[i2]}) flag++}}if flag > 1 &&! Exsit (recnodate) {exsit = append (Exsit, recnodate) WriteFile ([]string{strconv. ITOA (flag), rec})}}size = Len (exsit) F, err: = OS. OpenFile ("Debug.csv", OS. O_append|os. O_create, OS. Modeappend) Checkerr (ERR) defer f.close () f.writestring ("\XEF\XBB\XBF") Writer: = csv. Newwriter (f) for I: = 0; i < size; i++ {writer. Write ([]string{exsit[i]})}writer. Flush ()}func getstrings (path string) []string {f, err: = OS. Open (Path) Checkerr (ERR) defer F.close () records: = []string{}reader: = csv. Newreader (f) Record: = []string{}for {record, err = reader. Read () If err = = Io. EOF {break} else if nil! = Err {fmt. PRINTLN (err) return nil}records = Append (records, record[0])}return Records}func main () {var path stringif len (OS). Args) > 1 {path = OS. Args[1]} else {path, _ = OS. GETWD ()}findsame (path) fmt. Println ("done!")}