Skip to content

Commit e2da9c5

Browse files
committed
Review comment readability and linting
1 parent 3b6f653 commit e2da9c5

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ type Config struct {
6464
DNSSD hinting.DNSHintGeneratorConf `toml:"dnssd"`
6565
MDNS hinting.MDNSHintGeneratorConf `toml:"mdns"`
6666
Logging LogConfig `toml:"log,omitempty"`
67-
CryptoEngine string `toml:"crypto_engine,omitempty"`
67+
CryptoEngine string `toml:"crypto_engine,omitempty"`
6868
}
6969

70-
func (cfg Config) WorkingDir() string {
70+
func (cfg *Config) WorkingDir() string {
7171
return filepath.Join(cfg.SciondConfigDir, "bootstrapper")
7272
}
7373

config/sample.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ crypto_engine = "openssl"
4444
# Fixed hex string for the client DUID, no separators, no 0x prefix:
4545
#client_id = "0001000100000000deadbeefaabb"
4646
[ipv6]
47-
# Whether to enable IPv6 Neighbor Discovery Protocol (NDP)
47+
# Whether to enable IPv6 Neighbor Discovery Protocol (NDP) for the
4848
# Router Advertisement DNSSL and RDNS discovery or not (default false)
4949
enable = false
5050
[dnssd]

fetcher/crypto_cmds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
// Verify the signature of signedTopology
9-
// using the CA bundle rootCertsBundlePath, and outputs the verified payload to verifiedTopology.
9+
// using the CA bundle rootCertsBundlePath, and output the verified payload to verifiedTopology.
1010
func cmsVerifyOutput(ctx context.Context, signedTopology, rootCertsBundlePath, verifiedTopology string) (err error) {
1111
if !ctx.Value("nativeCrypto").(bool) {
1212
if err = checkExecutable("openssl"); err != nil {

fetcher/scion_cppki_verify.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func setupVerifyEnv(cfg *config.Config) (ctx context.Context, cancel context.Can
103103
// Signature verification should complete in a timely manner since it is a local operation
104104
ctx, cancel = context.WithTimeout(context.Background(), verifyTimeout)
105105

106-
// check 'scion-pki' tool is on path and executable
106+
// Check that 'scion-pki' tool is on path and executable
107107
if err = checkExecutable("scion-pki"); err != nil {
108108
return
109109
}
@@ -122,7 +122,7 @@ func setupVerifyEnv(cfg *config.Config) (ctx context.Context, cancel context.Can
122122
return
123123
}
124124

125-
func checkExecutable(execName string) (err error){
125+
func checkExecutable(execName string) (err error) {
126126
_, err = exec.LookPath(execName)
127127
return
128128
}

hinting/dhcpv6.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func getDuid(g *DHCPv6HintGenerator) (duid dhcpv6.Duid, err error) {
116116
}
117117
case duidEN, duidUUID:
118118
// Not implemented
119-
log.Error("Unsupported DUID type %s, set DUID directly as `client_id` " +
119+
log.Error("Unsupported DUID type %s, set DUID directly as `client_id` "+
120120
"or use the supported `DUID-LL` and `DUID-LLT`types.", "type", g.cfg.Duid)
121121
err = fmt.Errorf("not implemented DUID type: %s", g.cfg.Duid)
122122
default:

hinting/hinting.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
const (
28-
anapayaPEN = 55324 // Anapaya Systems Private Enterprise Number
28+
anapayaPEN = 55324 // Anapaya Systems Private Enterprise Number
2929
DiscoveryPort uint16 = 8041
3030
DNSInfoTimeout = 10 * time.Second
3131
)
@@ -205,7 +205,6 @@ func (m *MockHintGenerator) Generate(ipHintsChan chan<- net.TCPAddr) {
205205
ipHintsChan <- *tcpAddr
206206
}
207207

208-
209208
func HasIPv6(iface *net.Interface) bool {
210209
return len(ifaceIPv6Addrs(iface)) > 0
211210
}
@@ -225,7 +224,7 @@ func ifaceIPv6Addrs(iface *net.Interface) (ips []netip.Addr) {
225224
}
226225
ip, ok := netip.AddrFromSlice(ifaddr.IP)
227226
// do not include IPv6 mapped IPv4 addresses and IPv6 loopback
228-
if ok && ip.Is6() && !ip.Is4In6() && !ip.IsLoopback(){
227+
if ok && ip.Is6() && !ip.Is4In6() && !ip.IsLoopback() {
229228
ips = append(ips, ip)
230229
}
231230
}

res/packaging/debian/etc/scion/bootstrapper.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ crypto_engine = "openssl"
1818
# Whether to enable DHCPv6 discovery or not (default false)
1919
enable = true
2020
[ipv6]
21-
# Whether to enable IPv6 Neighbor Discovery Protocol (NDP)
21+
# Whether to enable IPv6 Neighbor Discovery Protocol (NDP) for the
2222
# Router Advertisement DNSSL and RDNS discovery or not (default false)
2323
enable = true
2424
[dnssd]

0 commit comments

Comments
 (0)