some linting
This commit is contained in:
parent
064035f1d8
commit
7ab2d355d5
5 changed files with 12 additions and 9 deletions
4
.gometalinter.json
Normal file
4
.gometalinter.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"Disable": ["golint"],
|
||||
"Vendor": true
|
||||
}
|
|
@ -93,4 +93,3 @@ deploy:
|
|||
secret_access_key:
|
||||
secure: "AxYRTy/GnjeTJKQdeJ/AEeAd+yXs783bFDKdyKNswtsHlU8sWPQgNcvTLpVqnSQMpiwkGDGi/70rvR5C+AT3SIWNw13RYrgBRpduQU0J+B2JS+3dN2DIePu25uvs++Wo22OfS8I+UjZ1mWY1SSHI2spPXvDCq5tb+Ih8nlYflEyAtxU9Oq2R3Kus2tkIlRnL25sP/2fY7RvuJFYIV63z8ZIJRzB5WzOeERqnXq2zfwos+hycAqyo/VevJnWAYTEDsvBuSODOpZF+QfKtIQ2rYSoqy8Lq1M6UOZimnC3Ulea4euBVf2ssBCnI7csGNG5UzkTiwrPDi2xIP8nM01rHW1yHJ7tQsJaghnUsfw2t6ui4ZofvbbOFTN/YCloHITifEi8Tc1/17isi3y+kX5yQ/Nk5UNry0Wbt91CP+nkL/ZmA5grkBXDL7VJMmB60TnO3ap24CtwBQartN3LoWs7h+4ov+LqbCt6IqpJVWQWlwJeb2MFPFByALtBpsqAyL1SxXlGNpPa94CuXxfQ6Bv436PtefA5FlTzR8uMmqsjWciv06bVnSvVlFEVovN2Fkplrjt7AASJ/8KJs4THDg4k61nfd8roAHx6ewQzl4wCWKCikQ0MuFd2mVHwdrbnCH1mIHuPRyvWMMIAK0ooc1/rmKiJlpgumjxoFYNE10MXtt+I="
|
||||
bucket: "lbry-reflector-binary"
|
||||
# local_dir: ./bin
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
|
||||
var dhtNodeID string
|
||||
var dhtPort int
|
||||
var dhtRpcPort int
|
||||
var dhtRPCPort int
|
||||
var dhtSeeds []string
|
||||
|
||||
func init() {
|
||||
|
@ -30,7 +30,7 @@ func init() {
|
|||
}
|
||||
cmd.PersistentFlags().StringVar(&dhtNodeID, "nodeID", "", "nodeID in hex")
|
||||
cmd.PersistentFlags().IntVar(&dhtPort, "port", 4567, "Port to start DHT on")
|
||||
cmd.PersistentFlags().IntVar(&dhtRpcPort, "rpcPort", 0, "Port to listen for rpc commands on")
|
||||
cmd.PersistentFlags().IntVar(&dhtRPCPort, "rpcPort", 0, "Port to listen for rpc commands on")
|
||||
cmd.PersistentFlags().StringSliceVar(&dhtSeeds, "seeds", []string{}, "Addresses of seed nodes")
|
||||
rootCmd.AddCommand(cmd)
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ func dhtCmd(cmd *cobra.Command, args []string) {
|
|||
|
||||
dhtConf := dht.NewStandardConfig()
|
||||
dhtConf.Address = "0.0.0.0:" + strconv.Itoa(dhtPort)
|
||||
dhtConf.RPCPort = dhtRpcPort
|
||||
dhtConf.RPCPort = dhtRPCPort
|
||||
if len(dhtSeeds) > 0 {
|
||||
dhtConf.SeedNodes = dhtSeeds
|
||||
}
|
||||
|
|
|
@ -339,7 +339,7 @@ func FromBigP(b *big.Int) Bitmap {
|
|||
return FromShortHexP(b.Text(16))
|
||||
}
|
||||
|
||||
// Max returns a bitmap with all bits set to 1
|
||||
// MaxP returns a bitmap with all bits set to 1
|
||||
func MaxP() Bitmap {
|
||||
return FromHexP(strings.Repeat("f", NumBytes*2))
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ func setBit(b []byte, n int, one bool) {
|
|||
}
|
||||
}
|
||||
|
||||
// CLosest returns the closest bitmap to target. if no bitmaps are provided, target itself is returned
|
||||
// Closest returns the closest bitmap to target. if no bitmaps are provided, target itself is returned
|
||||
func Closest(target Bitmap, bitmaps ...Bitmap) Bitmap {
|
||||
if len(bitmaps) == 0 {
|
||||
return target
|
||||
|
|
|
@ -48,12 +48,12 @@ func (s *stats) Shutdown() {
|
|||
func (s *stats) AddBlob() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.blobs += 1
|
||||
s.blobs++
|
||||
}
|
||||
func (s *stats) AddStream() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.streams += 1
|
||||
s.streams++
|
||||
}
|
||||
|
||||
func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but whataever
|
||||
|
@ -71,7 +71,7 @@ func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but
|
|||
shouldLog = true
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.errors[name] += 1
|
||||
s.errors[name]++
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue