cmd: fixed comment should be in form and receiver name messages from golint in the module

This commit is contained in:
nicozingarelli 2018-05-22 15:00:58 -07:00
parent 6ce21a4744
commit 10cfaada3c
4 changed files with 32 additions and 32 deletions

View file

@ -38,7 +38,7 @@ import (
)
var (
//flag definition for the dumpconfig command
// DumpConfigCommand flag definition for the dumpconfig command
DumpConfigCommand = cli.Command{
Action: utils.MigrateFlags(dumpConfig),
Name: "dumpconfig",
@ -49,7 +49,7 @@ var (
Description: `The dumpconfig command shows configuration values.`,
}
//flag definition for the config file command
// SwarmTomlConfigPathFlag flag definition for the config file command
SwarmTomlConfigPathFlag = cli.StringFlag{
Name: "config",
Usage: "TOML configuration file",

View file

@ -142,7 +142,7 @@ var (
EnvVar: SWARM_ENV_CORS,
}
// the following flags are deprecated and should be removed in the future
// DeprecatedEthAPIFlag the following flags are deprecated and should be removed in the future
DeprecatedEthAPIFlag = cli.StringFlag{
Name: "ethapi",
Usage: "DEPRECATED: please use --ens-api and --swap-api",

View file

@ -31,23 +31,23 @@ import (
"gopkg.in/urfave/cli.v1"
)
// Custom type which is registered in the flags library which cli uses for
// DirectoryString custom type which is registered in the flags library which cli uses for
// argument parsing. This allows us to expand Value to an absolute path when
// the argument is parsed
type DirectoryString struct {
Value string
}
func (self *DirectoryString) String() string {
return self.Value
func (ds *DirectoryString) String() string {
return ds.Value
}
func (self *DirectoryString) Set(value string) error {
self.Value = expandPath(value)
func (ds *DirectoryString) Set(value string) error {
ds.Value = expandPath(value)
return nil
}
// Custom cli.Flag type which expand the received string to an absolute path.
// DirectoryFlag custom cli.Flag type which expand the received string to an absolute path.
// e.g. ~/.ethereum -> /home/username/.ethereum
type DirectoryFlag struct {
Name string
@ -55,12 +55,12 @@ type DirectoryFlag struct {
Usage string
}
func (self DirectoryFlag) String() string {
func (df DirectoryFlag) String() string {
fmtString := "%s %v\t%v"
if len(self.Value.Value) > 0 {
if len(df.Value.Value) > 0 {
fmtString = "%s \"%v\"\t%v"
}
return fmt.Sprintf(fmtString, prefixedNames(self.Name), self.Value.Value, self.Usage)
return fmt.Sprintf(fmtString, prefixedNames(df.Name), df.Value.Value, df.Usage)
}
func eachName(longName string, fn func(string)) {
@ -71,11 +71,11 @@ func eachName(longName string, fn func(string)) {
}
}
// called by cli library, grabs variable from environment (if in env)
// Apply called by cli library, grabs variable from environment (if in env)
// and adds variable to flag set for parsing.
func (self DirectoryFlag) Apply(set *flag.FlagSet) {
eachName(self.Name, func(name string) {
set.Var(&self.Value, self.Name, self.Usage)
func (df DirectoryFlag) Apply(set *flag.FlagSet) {
eachName(df.Name, func(name string) {
set.Var(&df.Value, df.Name, df.Usage)
})
}
@ -207,12 +207,12 @@ func prefixedNames(fullName string) (prefixed string) {
return
}
func (self DirectoryFlag) GetName() string {
return self.Name
func (df DirectoryFlag) GetName() string {
return df.Name
}
func (self *DirectoryFlag) Set(value string) {
self.Value.Value = value
func (df *DirectoryFlag) Set(value string) {
df.Value.Value = value
}
// Expands a file path

View file

@ -112,7 +112,7 @@ func NewApp(gitCommit, usage string) *cli.App {
// are the same for all commands.
var (
// General settings
// DataDirFlag general settings
DataDirFlag = DirectoryFlag{
Name: "datadir",
Usage: "Data directory for the databases and keystore",
@ -189,7 +189,7 @@ var (
Name: "lightkdf",
Usage: "Reduce key-derivation RAM & CPU usage at some expense of KDF strength",
}
// Dashboard settings
// DashboardEnabledFlag dashboard settings
DashboardEnabledFlag = cli.BoolFlag{
Name: "dashboard",
Usage: "Enable the dashboard",
@ -209,7 +209,7 @@ var (
Usage: "Dashboard metrics collection refresh rate",
Value: dashboard.DefaultConfig.Refresh,
}
// Ethash settings
// EthashCacheDirFlag ethash settings
EthashCacheDirFlag = DirectoryFlag{
Name: "ethash.cachedir",
Usage: "Directory to store the ethash verification caches (default = inside the datadir)",
@ -239,7 +239,7 @@ var (
Usage: "Number of recent ethash mining DAGs to keep on disk (1+GB each)",
Value: eth.DefaultConfig.Ethash.DatasetsOnDisk,
}
// Transaction pool settings
// TxPoolNoLocalsFlag transaction pool settings
TxPoolNoLocalsFlag = cli.BoolFlag{
Name: "txpool.nolocals",
Usage: "Disables price exemptions for locally submitted transactions",
@ -289,7 +289,7 @@ var (
Usage: "Maximum amount of time non-executable transaction are queued",
Value: eth.DefaultConfig.TxPool.Lifetime,
}
// Performance tuning settings
// CacheFlag performance tuning settings
CacheFlag = cli.IntFlag{
Name: "cache",
Usage: "Megabytes of memory allocated to internal caching",
@ -310,7 +310,7 @@ var (
Usage: "Number of trie node generations to keep in memory",
Value: int(state.MaxTrieCacheGen),
}
// Miner settings
// MiningEnabledFlag miner settings
MiningEnabledFlag = cli.BoolFlag{
Name: "mine",
Usage: "Enable mining",
@ -339,7 +339,7 @@ var (
Name: "extradata",
Usage: "Block extra data set by the miner (default = client version)",
}
// Account settings
// UnlockedAccountFlag account settings
UnlockedAccountFlag = cli.StringFlag{
Name: "unlock",
Usage: "Comma separated list of accounts to unlock",
@ -355,7 +355,7 @@ var (
Name: "vmdebug",
Usage: "Record information useful for VM and contract debugging",
}
// Logging and debug settings
// EthStatsURLFlag logging and debug settings
EthStatsURLFlag = cli.StringFlag{
Name: "ethstats",
Usage: "Reporting URL of a ethstats service (nodename:secret@host:port)",
@ -372,7 +372,7 @@ var (
Name: "nocompaction",
Usage: "Disables db compaction after import",
}
// RPC settings
// RPCEnabledFlag RPC settings
RPCEnabledFlag = cli.BoolFlag{
Name: "rpc",
Usage: "Enable the HTTP-RPC server",
@ -443,7 +443,7 @@ var (
Usage: "Comma separated list of JavaScript files to preload into the console",
}
// Network Settings
// MaxPeersFlag network settings
MaxPeersFlag = cli.IntFlag{
Name: "maxpeers",
Usage: "Maximum number of network peers (network disabled if set to 0)",
@ -500,14 +500,14 @@ var (
Usage: "Restricts network communication to the given IP networks (CIDR masks)",
}
// ATM the url is left to the user and deployment to
// JSpathFlag ATM the url is left to the user and deployment to
JSpathFlag = cli.StringFlag{
Name: "jspath",
Usage: "JavaScript root path for `loadScript`",
Value: ".",
}
// Gas price oracle settings
// GpoBlocksFlag gas price oracle settings
GpoBlocksFlag = cli.IntFlag{
Name: "gpoblocks",
Usage: "Number of recent blocks to check for gas prices",