Skip to content

Commit 6aa339e

Browse files
committed
refactor: more changes to spacing and comments
1 parent ca98f73 commit 6aa339e

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

internal/certificatetransparency/ct-parser.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ func parseName(input []string) *string {
277277
return &result
278278
}
279279

280-
// calculateHash takes a hash.Hash struct and calculates the fingerprint of the given data.
280+
// calculateHash takes a hash.Hash implementation and calculates the hash of the given data.
281+
// It returns the hash in the format "XX:XX:XX:...".
281282
func calculateHash(data []byte, certHasher hash.Hash) string {
282283
_, e := certHasher.Write(data)
283284
if e != nil {

internal/certstream/certstream.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func (cs *Certstream) Start() {
9090
if cs.webserver == nil {
9191
log.Fatalln("Webserver not initialized! Exiting...")
9292
}
93+
9394
go cs.webserver.Start()
9495

9596
if cs.metricsServer != nil {

internal/web/broadcastmanager.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func (bm *BroadcastManager) registerClient(c *client) {
2626
// The client will no longer receive certificate broadcasts right after unregistering.
2727
func (bm *BroadcastManager) unregisterClient(c *client) {
2828
bm.clientLock.Lock()
29+
2930
for i, client := range bm.clients {
3031
if c == client {
3132
// Copy the last element of the slice to the position of the removed element
@@ -40,6 +41,7 @@ func (bm *BroadcastManager) unregisterClient(c *client) {
4041
break
4142
}
4243
}
44+
4345
bm.clientLock.Unlock()
4446
}
4547

@@ -88,13 +90,15 @@ func (bm *BroadcastManager) GetSkippedCerts() map[string]uint64 {
8890
// broadcaster is run in a goroutine and handles the dispatching of entries to clients.
8991
func (bm *BroadcastManager) broadcaster() {
9092
for {
93+
var data []byte
94+
9195
entry := <-bm.Broadcast
9296
dataLite := entry.JSONLite()
9397
dataFull := entry.JSON()
9498
dataDomain := entry.JSONDomains()
95-
var data []byte
9699

97100
bm.clientLock.RLock()
101+
98102
for _, c := range bm.clients {
99103
switch c.subType {
100104
case SubTypeLite:
@@ -118,6 +122,7 @@ func (bm *BroadcastManager) broadcaster() {
118122
}
119123
}
120124
}
125+
121126
bm.clientLock.RUnlock()
122127
}
123128
}

internal/web/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func (ws *WebServer) RegisterPrometheus(url string, callback func(w io.Writer, e
4949
func IPWhitelist(whitelist []string) func(next http.Handler) http.Handler {
5050
// build a list of whitelisted IPs and CIDRs
5151
log.Println("Building IP whitelist...")
52+
5253
var ipList []net.IP
5354
var cidrList []net.IPNet
5455

0 commit comments

Comments
 (0)