gofmt'd all my source code. No other changes.
authormishaz <misha@curoverse.com>
Tue, 13 Jan 2015 23:27:05 +0000 (23:27 +0000)
committerTom Clegg <tom@curoverse.com>
Fri, 13 Feb 2015 21:25:30 +0000 (16:25 -0500)
sdk/go/blockdigest/blockdigest.go
sdk/go/logger/logger.go
sdk/go/manifest/manifest.go
sdk/go/util/util.go
services/datamanager/collection/collection.go
services/datamanager/datamanager.go
services/datamanager/keep/keep.go
services/datamanager/loggerutil/loggerutil.go

index 5225af6554ee86353b7298887f4dbe33c814c7ec..0742839720c764788ccae6e505d37640e91655e8 100644 (file)
@@ -28,9 +28,13 @@ func FromString(s string) (dig BlockDigest, err error) {
 
        var d BlockDigest
        d.h, err = strconv.ParseUint(s[:16], 16, 64)
-       if err != nil {return}
+       if err != nil {
+               return
+       }
        d.l, err = strconv.ParseUint(s[16:], 16, 64)
-       if err != nil {return}
+       if err != nil {
+               return
+       }
        dig = d
        return
 }
index 294ba9214e0ed8fb485d3f3cc76adb94b433a8e2..ff57127e023ac507d299f4fd54fbeff8009fcee4 100644 (file)
@@ -32,33 +32,33 @@ import (
 )
 
 type LoggerParams struct {
-       Client arvadosclient.ArvadosClient  // The client we use to write log entries
-       EventType string  // The event type to assign to the log entry.
-       MinimumWriteInterval time.Duration  // Wait at least this long between log writes
+       Client               arvadosclient.ArvadosClient // The client we use to write log entries
+       EventType            string                      // The event type to assign to the log entry.
+       MinimumWriteInterval time.Duration               // Wait at least this long between log writes
 }
 
 // A Logger is used to build up a log entry over time and write every
 // version of it.
 type Logger struct {
        // The Data we write
-       data        map[string]interface{}  // The entire map that we give to the api
-       entry       map[string]interface{}  // Convenience shortcut into data
-       properties  map[string]interface{}  // Convenience shortcut into data
+       data       map[string]interface{} // The entire map that we give to the api
+       entry      map[string]interface{} // Convenience shortcut into data
+       properties map[string]interface{} // Convenience shortcut into data
 
-       lock        sync.Locker   // Synchronizes editing and writing
-       params      LoggerParams  // Parameters we were given
+       lock   sync.Locker  // Synchronizes editing and writing
+       params LoggerParams // Parameters we were given
 
-       lastWrite   time.Time  // The last time we wrote a log entry
-       modified    bool       // Has this data been modified since the last write
+       lastWrite time.Time // The last time we wrote a log entry
+       modified  bool      // Has this data been modified since the last write
 
-       writeHooks  []func(map[string]interface{},map[string]interface{})
+       writeHooks []func(map[string]interface{}, map[string]interface{})
 }
 
 // Create a new logger based on the specified parameters.
 func NewLogger(params LoggerParams) *Logger {
        // TODO(misha): Add some params checking here.
        l := &Logger{data: make(map[string]interface{}),
-               lock: &sync.Mutex{},
+               lock:   &sync.Mutex{},
                params: params}
        l.entry = make(map[string]interface{})
        l.data["log"] = l.entry
@@ -70,13 +70,13 @@ func NewLogger(params LoggerParams) *Logger {
 // Get access to the maps you can edit. This will hold a lock until
 // you call Record. Do not edit the maps in any other goroutines or
 // after calling Record.
-// You don't need to edit both maps, 
+// You don't need to edit both maps,
 // properties can take any values you want to give it,
 // entry will only take the fields listed at http://doc.arvados.org/api/schema/Log.html
 // properties is a shortcut for entry["properties"].(map[string]interface{})
 func (l *Logger) Edit() (properties map[string]interface{}, entry map[string]interface{}) {
        l.lock.Lock()
-       l.modified = true  // We don't actually know the caller will modifiy the data, but we assume they will.
+       l.modified = true // We don't actually know the caller will modifiy the data, but we assume they will.
 
        return l.properties, l.entry
 }
@@ -120,7 +120,6 @@ func (l *Logger) writeAllowedNow() bool {
        return l.lastWrite.Add(l.params.MinimumWriteInterval).Before(time.Now())
 }
 
-
 // Actually writes the log entry. This method assumes we're holding the lock.
 func (l *Logger) write() {
 
@@ -144,7 +143,6 @@ func (l *Logger) write() {
        l.modified = false
 }
 
-
 func (l *Logger) acquireLockConsiderWriting() {
        l.lock.Lock()
        if l.modified && l.writeAllowedNow() {
index 1227f4936fcf9a104a21aa6c41529dfe94570626..c9f90185547f03ea58ab3809833d7a6a22927883 100644 (file)
@@ -21,20 +21,20 @@ type Manifest struct {
 }
 
 type BlockLocator struct {
-       Digest  blockdigest.BlockDigest
-       Size    int
-       Hints   []string
+       Digest blockdigest.BlockDigest
+       Size   int
+       Hints  []string
 }
 
 type ManifestLine struct {
-       StreamName  string
-       Blocks       []string
-       Files        []string
+       StreamName string
+       Blocks     []string
+       Files      []string
 }
 
 func ParseBlockLocator(s string) (b BlockLocator, err error) {
        if !LocatorPattern.MatchString(s) {
-               err = fmt.Errorf("String \"%s\" does not match BlockLocator pattern " +
+               err = fmt.Errorf("String \"%s\" does not match BlockLocator pattern "+
                        "\"%s\".",
                        s,
                        LocatorPattern.String())
@@ -45,9 +45,13 @@ func ParseBlockLocator(s string) (b BlockLocator, err error) {
                // We expect both of the following to succeed since LocatorPattern
                // restricts the strings appropriately.
                blockDigest, err = blockdigest.FromString(tokens[0])
-               if err != nil {return}
+               if err != nil {
+                       return
+               }
                blockSize, err = strconv.ParseInt(tokens[1], 10, 0)
-               if err != nil {return}
+               if err != nil {
+                       return
+               }
                b.Digest = blockDigest
                b.Size = int(blockSize)
                b.Hints = tokens[2:]
@@ -92,7 +96,6 @@ func (m *Manifest) LineIter() <-chan ManifestLine {
        return ch
 }
 
-
 // Blocks may appear mulitple times within the same manifest if they
 // are used by multiple files. In that case this Iterator will output
 // the same block multiple times.
index 9b0fe213614c9d5ad1e0591665bca5573c77e92d..4505db6a52720ef762a8555d4c95821bd8f7a81c 100644 (file)
@@ -56,7 +56,7 @@ func ContainsAllAvailableItems(response SdkListResponse) (containsAll bool, numC
        }
        numAvailable, err = response.NumItemsAvailable()
        if err != nil {
-               log.Fatalf("Error retrieving number of items available from " +
+               log.Fatalf("Error retrieving number of items available from "+
                        "SDK response: %v",
                        err)
        }
index fbdec1516a9cbf023cf8afad1f12a06606b3559f..73115f5fc9b4d41131a56bdfc0cde528da6ec348 100644 (file)
@@ -21,44 +21,44 @@ var (
        heap_profile_filename string
        // globals for debugging
        totalManifestSize uint64
-       maxManifestSize uint64
+       maxManifestSize   uint64
 )
 
 type Collection struct {
-       Uuid string
-       OwnerUuid string
-       ReplicationLevel int
+       Uuid              string
+       OwnerUuid         string
+       ReplicationLevel  int
        BlockDigestToSize map[blockdigest.BlockDigest]int
-       TotalSize int
+       TotalSize         int
 }
 
 type ReadCollections struct {
-       ReadAllCollections bool
-       UuidToCollection map[string]Collection
+       ReadAllCollections    bool
+       UuidToCollection      map[string]Collection
        OwnerToCollectionSize map[string]int
 }
 
 type GetCollectionsParams struct {
-       Client arvadosclient.ArvadosClient
-       Logger *logger.Logger
+       Client    arvadosclient.ArvadosClient
+       Logger    *logger.Logger
        BatchSize int
 }
 
 type SdkCollectionInfo struct {
-       Uuid           string     `json:"uuid"`
-       OwnerUuid      string     `json:"owner_uuid"`
-       Redundancy     int        `json:"redundancy"`
-       ModifiedAt     time.Time  `json:"modified_at"`
-       ManifestText   string     `json:"manifest_text"`
+       Uuid         string    `json:"uuid"`
+       OwnerUuid    string    `json:"owner_uuid"`
+       Redundancy   int       `json:"redundancy"`
+       ModifiedAt   time.Time `json:"modified_at"`
+       ManifestText string    `json:"manifest_text"`
 }
 
 type SdkCollectionList struct {
-       ItemsAvailable   int                   `json:"items_available"`
-       Items            []SdkCollectionInfo   `json:"items"`
+       ItemsAvailable int                 `json:"items_available"`
+       Items          []SdkCollectionInfo `json:"items"`
 }
 
 func init() {
-       flag.StringVar(&heap_profile_filename, 
+       flag.StringVar(&heap_profile_filename,
                "heap-profile",
                "",
                "File to write the heap profiles to. Leave blank to skip profiling.")
@@ -96,13 +96,12 @@ func WriteHeapProfile() {
        }
 }
 
-
 func GetCollectionsAndSummarize(params GetCollectionsParams) (results ReadCollections) {
        results = GetCollections(params)
        ComputeSizeOfOwnedCollections(&results)
 
        if params.Logger != nil {
-               properties,_ := params.Logger.Edit()
+               properties, _ := params.Logger.Edit()
                collectionInfo := properties["collection_info"].(map[string]interface{})
                collectionInfo["owner_to_collection_size"] = results.OwnerToCollectionSize
                params.Logger.Record()
@@ -136,8 +135,8 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections) {
                "modified_at"}
 
        sdkParams := arvadosclient.Dict{
-               "select": fieldsWanted,
-               "order": []string{"modified_at ASC"},
+               "select":  fieldsWanted,
+               "order":   []string{"modified_at ASC"},
                "filters": [][]string{[]string{"modified_at", ">=", "1900-01-01T00:00:00Z"}}}
 
        if params.BatchSize > 0 {
@@ -152,7 +151,7 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections) {
        results.UuidToCollection = make(map[string]Collection, maxExpectedCollections)
 
        if params.Logger != nil {
-               properties,_ := params.Logger.Edit()
+               properties, _ := params.Logger.Edit()
                collectionInfo := make(map[string]interface{})
                collectionInfo["num_collections_at_start"] = initialNumberOfCollectionsAvailable
                collectionInfo["batch_size"] = params.BatchSize
@@ -181,23 +180,23 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections) {
                // Process collection and update our date filter.
                sdkParams["filters"].([][]string)[0][2] =
                        ProcessCollections(params.Logger,
-                       collections.Items,
-                       results.UuidToCollection).Format(time.RFC3339)
+                               collections.Items,
+                               results.UuidToCollection).Format(time.RFC3339)
 
                // update counts
                previousTotalCollections = totalCollections
                totalCollections = len(results.UuidToCollection)
 
-               log.Printf("%d collections read, %d new in last batch, " +
+               log.Printf("%d collections read, %d new in last batch, "+
                        "%s latest modified date, %.0f %d %d avg,max,total manifest size",
                        totalCollections,
-                       totalCollections - previousTotalCollections,
+                       totalCollections-previousTotalCollections,
                        sdkParams["filters"].([][]string)[0][2],
                        float32(totalManifestSize)/float32(totalCollections),
                        maxManifestSize, totalManifestSize)
 
                if params.Logger != nil {
-                       properties,_ := params.Logger.Edit()
+                       properties, _ := params.Logger.Edit()
                        collectionInfo := properties["collection_info"].(map[string]interface{})
                        collectionInfo["collections_read"] = totalCollections
                        collectionInfo["latest_modified_date_seen"] = sdkParams["filters"].([][]string)[0][2]
@@ -216,7 +215,6 @@ func GetCollections(params GetCollectionsParams) (results ReadCollections) {
        return
 }
 
-
 // StrCopy returns a newly allocated string.
 // It is useful to copy slices so that the garbage collector can reuse
 // the memory of the longer strings they came from.
@@ -224,22 +222,21 @@ func StrCopy(s string) string {
        return string([]byte(s))
 }
 
-
 func ProcessCollections(arvLogger *logger.Logger,
        receivedCollections []SdkCollectionInfo,
        uuidToCollection map[string]Collection) (latestModificationDate time.Time) {
        for _, sdkCollection := range receivedCollections {
                collection := Collection{Uuid: StrCopy(sdkCollection.Uuid),
-                       OwnerUuid: StrCopy(sdkCollection.OwnerUuid),
-                       ReplicationLevel: sdkCollection.Redundancy,
+                       OwnerUuid:         StrCopy(sdkCollection.OwnerUuid),
+                       ReplicationLevel:  sdkCollection.Redundancy,
                        BlockDigestToSize: make(map[blockdigest.BlockDigest]int)}
 
                if sdkCollection.ModifiedAt.IsZero() {
                        loggerutil.FatalWithMessage(arvLogger,
                                fmt.Sprintf(
-                                       "Arvados SDK collection returned with unexpected zero " +
-                                               "modifcation date. This probably means that either we failed to " +
-                                               "parse the modification date or the API server has changed how " +
+                                       "Arvados SDK collection returned with unexpected zero "+
+                                               "modifcation date. This probably means that either we failed to "+
+                                               "parse the modification date or the API server has changed how "+
                                                "it returns modification dates: %v",
                                        collection))
                }
@@ -256,11 +253,10 @@ func ProcessCollections(arvLogger *logger.Logger,
                if manifestSize > maxManifestSize {
                        maxManifestSize = manifestSize
                }
-               
+
                blockChannel := manifest.BlockIterWithDuplicates()
                for block := range blockChannel {
-                       if stored_size, stored := collection.BlockDigestToSize[block.Digest];
-                       stored && stored_size != block.Size {
+                       if stored_size, stored := collection.BlockDigestToSize[block.Digest]; stored && stored_size != block.Size {
                                message := fmt.Sprintf(
                                        "Collection %s contains multiple sizes (%d and %d) for block %s",
                                        collection.Uuid,
@@ -286,8 +282,7 @@ func ProcessCollections(arvLogger *logger.Logger,
        return
 }
 
-
-func NumberCollectionsAvailable(client arvadosclient.ArvadosClient) (int) {
+func NumberCollectionsAvailable(client arvadosclient.ArvadosClient) int {
        var collections SdkCollectionList
        sdkParams := arvadosclient.Dict{"limit": 0}
        err := client.List("collections", sdkParams, &collections)
@@ -298,7 +293,6 @@ func NumberCollectionsAvailable(client arvadosclient.ArvadosClient) (int) {
        return collections.ItemsAvailable
 }
 
-
 func ComputeSizeOfOwnedCollections(readCollections *ReadCollections) {
        readCollections.OwnerToCollectionSize = make(map[string]int)
        for _, coll := range readCollections.UuidToCollection {
index d7d926e2bcda68193a9c3447eccd5b931a52beb6..e73bdb96530f56d39b8934087025c80a6e59ed02 100644 (file)
@@ -16,16 +16,16 @@ import (
 )
 
 var (
-       logEventType string
+       logEventType        string
        logFrequencySeconds int
 )
 
 func init() {
-       flag.StringVar(&logEventType, 
+       flag.StringVar(&logEventType,
                "log-event-type",
                "experimental-data-manager-report",
                "event_type to use in our arvados log entries. Set to empty to turn off logging")
-       flag.IntVar(&logFrequencySeconds, 
+       flag.IntVar(&logFrequencySeconds,
                "log-frequency-seconds",
                20,
                "How frequently we'll write log entries in seconds.")
@@ -48,7 +48,7 @@ func main() {
        var arvLogger *logger.Logger
        if logEventType != "" {
                arvLogger = logger.NewLogger(logger.LoggerParams{Client: arv,
-                       EventType: logEventType,
+                       EventType:            logEventType,
                        MinimumWriteInterval: time.Second * time.Duration(logFrequencySeconds)})
        }
 
@@ -73,22 +73,24 @@ func main() {
 
        collectionChannel := make(chan collection.ReadCollections)
 
-       go func() { collectionChannel <- collection.GetCollectionsAndSummarize(
-               collection.GetCollectionsParams{
-                       Client: arv, Logger: arvLogger, BatchSize: 50}) }()
+       go func() {
+               collectionChannel <- collection.GetCollectionsAndSummarize(
+                       collection.GetCollectionsParams{
+                               Client: arv, Logger: arvLogger, BatchSize: 50})
+       }()
 
        keepServerInfo := keep.GetKeepServersAndSummarize(
                keep.GetKeepServersParams{Client: arv, Logger: arvLogger, Limit: 1000})
 
        readCollections := <-collectionChannel
 
-  // Make compiler happy.
+       // Make compiler happy.
        _ = readCollections
        _ = keepServerInfo
 
        // Log that we're finished
        if arvLogger != nil {
-               properties,_ := arvLogger.Edit()
+               properties, _ := arvLogger.Edit()
                properties["run_info"].(map[string]interface{})["end_time"] = time.Now()
                // Force the recording, since go will not wait for the timer before exiting.
                arvLogger.ForceRecord()
@@ -96,7 +98,7 @@ func main() {
 }
 
 func LogMemoryAlloc(properties map[string]interface{}, entry map[string]interface{}) {
-       _ = entry  // keep the compiler from complaining
+       _ = entry // keep the compiler from complaining
        runInfo := properties["run_info"].(map[string]interface{})
        var memStats runtime.MemStats
        runtime.ReadMemStats(&memStats)
index 8b4606649cfdb8715aa76583fda07772fb1fbac8..b9e6df03b0994f7e47279c1209883f05c3ab6c8a 100644 (file)
@@ -13,8 +13,8 @@ import (
        "git.curoverse.com/arvados.git/sdk/go/manifest"
        "git.curoverse.com/arvados.git/sdk/go/util"
        "git.curoverse.com/arvados.git/services/datamanager/loggerutil"
-       "log"
        "io/ioutil"
+       "log"
        "net/http"
        "strconv"
        "strings"
@@ -23,21 +23,21 @@ import (
 
 type ServerAddress struct {
        Host string `json:"service_host"`
-       Port int `json:"service_port"`
+       Port int    `json:"service_port"`
 }
 
 // Info about a particular block returned by the server
 type BlockInfo struct {
-       Digest     blockdigest.BlockDigest
-       Size       int
-       Mtime      int  // TODO(misha): Replace this with a timestamp.
+       Digest blockdigest.BlockDigest
+       Size   int
+       Mtime  int // TODO(misha): Replace this with a timestamp.
 }
 
 // Info about a specified block given by a server
 type BlockServerInfo struct {
        ServerIndex int
        Size        int
-       Mtime       int  // TODO(misha): Replace this with a timestamp.
+       Mtime       int // TODO(misha): Replace this with a timestamp.
 }
 
 type ServerContents struct {
@@ -45,28 +45,28 @@ type ServerContents struct {
 }
 
 type ServerResponse struct {
-       Address ServerAddress
+       Address  ServerAddress
        Contents ServerContents
 }
 
 type ReadServers struct {
-       ReadAllServers            bool
-       KeepServerIndexToAddress  []ServerAddress
-       KeepServerAddressToIndex  map[ServerAddress]int
-       ServerToContents          map[ServerAddress]ServerContents
-       BlockToServers            map[blockdigest.BlockDigest][]BlockServerInfo
-       BlockReplicationCounts    map[int]int
+       ReadAllServers           bool
+       KeepServerIndexToAddress []ServerAddress
+       KeepServerAddressToIndex map[ServerAddress]int
+       ServerToContents         map[ServerAddress]ServerContents
+       BlockToServers           map[blockdigest.BlockDigest][]BlockServerInfo
+       BlockReplicationCounts   map[int]int
 }
 
 type GetKeepServersParams struct {
        Client arvadosclient.ArvadosClient
        Logger *logger.Logger
-       Limit int
+       Limit  int
 }
 
 type KeepServiceList struct {
-       ItemsAvailable int `json:"items_available"`
-       KeepServers []ServerAddress `json:"items"`
+       ItemsAvailable int             `json:"items_available"`
+       KeepServers    []ServerAddress `json:"items"`
 }
 
 // Methods to implement util.SdkListResponse Interface
@@ -81,20 +81,20 @@ func (k KeepServiceList) NumItemsContained() (numContained int, err error) {
 var (
        // Don't access the token directly, use getDataManagerToken() to
        // make sure it's been read.
-       dataManagerToken                string
-       dataManagerTokenFile            string
-       dataManagerTokenFileReadOnce    sync.Once
+       dataManagerToken             string
+       dataManagerTokenFile         string
+       dataManagerTokenFileReadOnce sync.Once
 )
 
 func init() {
-       flag.StringVar(&dataManagerTokenFile, 
+       flag.StringVar(&dataManagerTokenFile,
                "data-manager-token-file",
                "",
                "File with the API token we should use to contact keep servers.")
 }
 
-func getDataManagerToken(arvLogger *logger.Logger) (string) {
-       readDataManagerToken := func () {
+func getDataManagerToken(arvLogger *logger.Logger) string {
+       readDataManagerToken := func() {
                if dataManagerTokenFile == "" {
                        flag.Usage()
                        loggerutil.FatalWithMessage(arvLogger,
@@ -151,7 +151,7 @@ func GetKeepServers(params GetKeepServersParams) (results ReadServers) {
                results.ReadAllServers, numReceived, numAvailable =
                        util.ContainsAllAvailableItems(sdkResponse)
 
-               if (!results.ReadAllServers) {
+               if !results.ReadAllServers {
                        log.Printf("ERROR: Did not receive all keep server addresses.")
                }
                log.Printf("Received %d of %d available keep server addresses.",
@@ -160,7 +160,7 @@ func GetKeepServers(params GetKeepServersParams) (results ReadServers) {
        }
 
        if params.Logger != nil {
-               properties,_ := params.Logger.Edit()
+               properties, _ := params.Logger.Edit()
                keepInfo := make(map[string]interface{})
 
                keepInfo["num_keep_servers_available"] = sdkResponse.ItemsAvailable
@@ -196,8 +196,8 @@ func GetKeepServers(params GetKeepServersParams) (results ReadServers) {
 
        // Read all the responses
        for i := range sdkResponse.KeepServers {
-               _ = i  // Here to prevent go from complaining.
-               response := <- responseChan
+               _ = i // Here to prevent go from complaining.
+               response := <-responseChan
                log.Printf("Received channel response from %v containing %d files",
                        response.Address,
                        len(response.Contents.BlockDigestToInfo))
@@ -207,7 +207,7 @@ func GetKeepServers(params GetKeepServersParams) (results ReadServers) {
                        results.BlockToServers[blockInfo.Digest] = append(
                                results.BlockToServers[blockInfo.Digest],
                                BlockServerInfo{ServerIndex: serverIndex,
-                                       Size: blockInfo.Size,
+                                       Size:  blockInfo.Size,
                                        Mtime: blockInfo.Mtime})
                }
        }
@@ -219,7 +219,7 @@ func GetKeepServers(params GetKeepServersParams) (results ReadServers) {
 func GetServerContents(arvLogger *logger.Logger,
        keepServer ServerAddress,
        client http.Client,
-       responseChan chan<- ServerResponse) () {
+       responseChan chan<- ServerResponse) {
        // Create and send request.
        url := fmt.Sprintf("http://%s:%d/index", keepServer.Host, keepServer.Port)
        log.Println("About to fetch keep server contents from " + url)
@@ -273,7 +273,7 @@ func GetServerContents(arvLogger *logger.Logger,
                        // the case of a size tie.
                        if storedBlock.Size < blockInfo.Size ||
                                (storedBlock.Size == blockInfo.Size &&
-                               storedBlock.Mtime < blockInfo.Mtime) {
+                                       storedBlock.Mtime < blockInfo.Mtime) {
                                response.Contents.BlockDigestToInfo[blockInfo.Digest] = blockInfo
                        }
                } else {
@@ -283,7 +283,7 @@ func GetServerContents(arvLogger *logger.Logger,
        if err := scanner.Err(); err != nil {
                log.Fatalf("Received error scanning response from %s: %v", url, err)
        } else {
-               log.Printf("%s contained %d lines with %d duplicates with " +
+               log.Printf("%s contained %d lines with %d duplicates with "+
                        "%d size disagreements",
                        url,
                        numLines,
@@ -297,7 +297,7 @@ func GetServerContents(arvLogger *logger.Logger,
 func parseBlockInfoFromIndexLine(indexLine string) (blockInfo BlockInfo, err error) {
        tokens := strings.Fields(indexLine)
        if len(tokens) != 2 {
-               err = fmt.Errorf("Expected 2 tokens per line but received a " + 
+               err = fmt.Errorf("Expected 2 tokens per line but received a "+
                        "line containing %v instead.",
                        tokens)
        }
@@ -307,7 +307,7 @@ func parseBlockInfoFromIndexLine(indexLine string) (blockInfo BlockInfo, err err
                return
        }
        if len(locator.Hints) > 0 {
-               err = fmt.Errorf("Block locator in index line should not contain hints " +
+               err = fmt.Errorf("Block locator in index line should not contain hints "+
                        "but it does: %v",
                        locator)
                return
index e4a53c2d054fc75695614789b3e62666b1e12cec..f97f7c16c4d98eeb2da523a51a259475340c08a4 100644 (file)
@@ -13,7 +13,7 @@ import (
 // for the lock you're already holding.
 func FatalWithMessage(arvLogger *logger.Logger, message string) {
        if arvLogger != nil {
-               properties,_ := arvLogger.Edit()
+               properties, _ := arvLogger.Edit()
                properties["FATAL"] = message
                properties["run_info"].(map[string]interface{})["end_time"] = time.Now()
                arvLogger.ForceRecord()
@@ -21,4 +21,3 @@ func FatalWithMessage(arvLogger *logger.Logger, message string) {
 
        log.Fatalf(message)
 }
-