format package

This commit is contained in:
dave 2017-11-09 00:18:15 -08:00
parent 2d93ddb7f3
commit dad38143b0
3 changed files with 8 additions and 14 deletions

6
go/Makefile Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env make
all: ilogarchivego
ilogarchivego:
go build -o iloggo src/containers.go src/archive.go

View File

@ -30,8 +30,6 @@ var (
cmd_split = kingpin.Command("split", "Split archives by date")
)
type LogInfo struct {
file os.FileInfo
path string
@ -56,8 +54,9 @@ func discover_logs(srcdir string) ([]LogInfo) {
return logs
}
var re_fname = regexp.MustCompile("((?P<network>[^_]+)_)?(?P<channel>.+)_(?P<date>[0-9]+)\\.log")
func parse_log_name(logname string) (LogInfo) {
re_fname := regexp.MustCompile("((?P<network>[^_]+)_)?(?P<channel>.+)_(?P<date>[0-9]+)\\.log")
matches := re_fname.FindStringSubmatch(logname)
if len(matches) != 5 { // re should match [garbage, garbage, network, channel, date]
@ -163,8 +162,6 @@ func cmd_import_do(srcdir string, outdir string, impall bool) {
wg.Wait()
}
func cmd_inspect_do(fpath string) {
log := &CombinedLogfile{
fpath: fpath,
@ -191,7 +188,6 @@ func cmd_inspect_do(fpath string) {
fmt.Print(asText)
}
func main() {
switch kingpin.Parse() {
case "import":

View File

@ -5,18 +5,10 @@ import (
"os"
"fmt"
"bufio"
// "strings"
"bytes"
"encoding/json"
// zmq "github.com/pebbe/zmq4"
// "strconv"
"time"
"sort"
// "strings"
// "math/rand"
// "errors"
// "bytes"
// "sync"
)
type errorString struct { // TODO "trivial implementation of error"