Created
December 16, 2014 11:08
-
-
Save r4um/934b0de0ff1915fab954 to your computer and use it in GitHub Desktop.
compress range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/xaviershay/erg" | |
"io" | |
"log" | |
) | |
func main() { | |
nodes := make([]string, 0) | |
var node string | |
var e *erg.Erg | |
for { | |
_, err := fmt.Scan(&node) | |
if err != nil { | |
if err != io.EOF { | |
log.Fatal(err) | |
} | |
break | |
} | |
nodes = append(nodes, node) | |
} | |
fmt.Println(e.Compress(nodes)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment