From 07a9cdf5133ac1150a963fdbeff73ef02076db4b Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Wed, 24 Apr 2019 12:58:05 -0700 Subject: [PATCH] removing go-sdk stuff --- fileutil.go | 10 ++++------ parse.go | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/fileutil.go b/fileutil.go index 0b832e2..f1a7768 100644 --- a/fileutil.go +++ b/fileutil.go @@ -4,15 +4,13 @@ import ( "bufio" "io" "os" - - "github.com/blend/go-sdk/exception" ) // ReadLines reads a file and calls the handler for each line. func ReadLines(filePath string, handler func(string) error) error { f, err := os.Open(filePath) if err != nil { - return exception.New(err) + return err } defer f.Close() @@ -21,7 +19,7 @@ func ReadLines(filePath string, handler func(string) error) error { line := scanner.Text() err = handler(line) if err != nil { - return exception.New(err) + return err } } return nil @@ -31,7 +29,7 @@ func ReadLines(filePath string, handler func(string) error) error { func ReadChunks(filePath string, chunkSize int, handler func([]byte) error) error { f, err := os.Open(filePath) if err != nil { - return exception.New(err) + return err } defer f.Close() @@ -44,7 +42,7 @@ func ReadChunks(filePath string, chunkSize int, handler func([]byte) error) erro readData := chunk[:readBytes] err = handler(readData) if err != nil { - return exception.New(err) + return err } } return nil diff --git a/parse.go b/parse.go index f38f6cc..5ecae0a 100644 --- a/parse.go +++ b/parse.go @@ -4,8 +4,6 @@ import ( "strconv" "strings" "time" - - "github.com/blend/go-sdk/exception" ) // ParseFloats parses a list of floats. @@ -20,7 +18,7 @@ func ParseFloats(values ...string) ([]float64, error) { continue } if parsedValue, err = strconv.ParseFloat(cleaned, 64); err != nil { - return nil, exception.New(err) + return nil, err } output = append(output, parsedValue) } @@ -34,7 +32,7 @@ func ParseTimes(layout string, values ...string) ([]time.Time, error) { var err error for _, value := range values { if parsedValue, err = time.Parse(layout, value); err != nil { - return nil, exception.New(err) + return nil, err } output = append(output, parsedValue) }