Skip to content

Instantly share code, notes, and snippets.

@r4um
Created December 16, 2014 11:08
Show Gist options
  • Save r4um/934b0de0ff1915fab954 to your computer and use it in GitHub Desktop.
Save r4um/934b0de0ff1915fab954 to your computer and use it in GitHub Desktop.
compress range.
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