Skip to content

Commit

Permalink
fix lint errors for cmd/...
Browse files Browse the repository at this point in the history
corrects the initialize package comment for lint

brings c.ServerVersion back
  • Loading branch information
Pablo Miranda committed Nov 11, 2015
1 parent 6ecb62e commit b908cbb
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions cmd/influx/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ func (c *CommandLine) Connect(cmd string) error {
} else {
c.ServerVersion = v
}

_, c.ServerVersion, _ = c.Client.Ping()

return nil
}

Expand Down
1 change: 1 addition & 0 deletions cmd/influx_inspect/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func u64tob(v uint64) []byte {
return b
}

// ShardIDs is a collection of UINT 64 that represent shard ids.
type ShardIDs []uint64

func (a ShardIDs) Len() int { return len(a) }
Expand Down
8 changes: 4 additions & 4 deletions cmd/influx_inspect/tsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (b *blockStats) inc(typ int, enc byte) {
for len(b.counts[typ]) <= int(enc) {
b.counts[typ] = append(b.counts[typ], 0)
}
b.counts[typ][enc] += 1
b.counts[typ][enc]++
}

func (b *blockStats) size(sz int) {
Expand Down Expand Up @@ -300,7 +300,7 @@ func cmdDumpTsm1(opts *tsdmDumpOpts) {

// Possible corruption? Try to read as much as we can and point to the problem.
if key == "" {
errors = append(errors, fmt.Errorf("index pos %d, field id: %d, missing key for id.", i, block.id))
errors = append(errors, fmt.Errorf("index pos %d, field id: %d, missing key for id", i, block.id))
} else if len(split) < 2 {
errors = append(errors, fmt.Errorf("index pos %d, field id: %d, key corrupt: got '%v'", i, block.id, key))
} else {
Expand Down Expand Up @@ -382,7 +382,7 @@ func cmdDumpTsm1(opts *tsdmDumpOpts) {

if opts.filterKey != "" && !strings.Contains(invIds[id], opts.filterKey) {
i += (12 + int64(length))
blockCount += 1
blockCount++
continue
}

Expand All @@ -399,7 +399,7 @@ func cmdDumpTsm1(opts *tsdmDumpOpts) {
}, "\t"))

i += (12 + int64(length))
blockCount += 1
blockCount++
}
if opts.dumpBlocks {
println("Blocks:")
Expand Down
4 changes: 2 additions & 2 deletions cmd/influxd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

// These variables are populated via the Go linker.
var (
version string = "0.9"
version = "0.9"
commit string
branch string
buildTime string
Expand Down Expand Up @@ -169,7 +169,7 @@ func ParseCommandName(args []string) (string, []string) {
return "", args
}

// Command represents the command executed by "influxd version".
// VersionCommand represents the command executed by "influxd version".
type VersionCommand struct {
Stdout io.Writer
Stderr io.Writer
Expand Down
1 change: 1 addition & 0 deletions cmd/influxd/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (cmd *Command) Run(args ...string) error {
return cmd.Restore(config, path)
}

// Restore restores a database snapshot
func (cmd *Command) Restore(config *Config, path string) error {
// Remove meta and data directories.
if err := os.RemoveAll(config.Meta.Dir); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (cmd *Command) Run(args ...string) error {

// Validate the configuration.
if err := config.Validate(); err != nil {
return fmt.Errorf("%s. To generate a valid configuration file run `influxd config > influxdb.generated.conf`.", err)
return fmt.Errorf("%s. To generate a valid configuration file run `influxd config > influxdb.generated.conf`", err)
}

// Create server from config and start it.
Expand Down
1 change: 1 addition & 0 deletions cmd/influxd/run/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func (c *Config) Validate() error {
return nil
}

// ApplyEnvOverrides apply the environment configuration on top of the config.
func (c *Config) ApplyEnvOverrides() error {
return c.applyEnvOverrides("INFLUXDB", reflect.ValueOf(c))
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/run/config_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (cmd *PrintConfigCommand) Run(args ...string) error {

// Validate the configuration.
if err := config.Validate(); err != nil {
return fmt.Errorf("%s. To generate a valid configuration file run `influxd config > influxdb.generated.conf`.", err)
return fmt.Errorf("%s. To generate a valid configuration file run `influxd config > influxdb.generated.conf`", err)
}

toml.NewEncoder(cmd.Stdout).Encode(config)
Expand Down
1 change: 1 addition & 0 deletions cmd/influxd/run/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/influxdb/influxdb/services/udp"
"github.com/influxdb/influxdb/tcp"
"github.com/influxdb/influxdb/tsdb"
// Initialize the engine packages
_ "github.com/influxdb/influxdb/tsdb/engine"
)

Expand Down

0 comments on commit b908cbb

Please sign in to comment.