2
0
mirror of synced 2025-02-25 07:05:38 +00:00
Matt Joiner fc4fab91f5 Switch to goimports import sorting
Used to use sortimports, but it's old, and goimports seems to have an opinion now.
2018-11-02 23:12:01 +11:00

27 lines
491 B
Go

// Takes P2P blocklist text format in stdin, and outputs the packed format
// from the iplist package.
package main
import (
"bufio"
"os"
"github.com/anacrolix/missinggo"
"github.com/anacrolix/tagflag"
"github.com/anacrolix/torrent/iplist"
)
func main() {
tagflag.Parse(nil)
l, err := iplist.NewFromReader(os.Stdin)
if err != nil {
missinggo.Fatal(err)
}
wb := bufio.NewWriter(os.Stdout)
defer wb.Flush()
err = l.WritePacked(wb)
if err != nil {
missinggo.Fatal(err)
}
}