mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
style: Apply go fmt to go code (#2046)
~I will add pre-commit hook later if I find a good one~ Found a nice repo, but it is no longer maintained: https://github.com/dnephin/pre-commit-golang So, I implemented the check as a local hook.
This commit is contained in:
@@ -8,22 +8,22 @@ import (
|
||||
)
|
||||
|
||||
type AmmoProvider struct {
|
||||
ammo []string
|
||||
ammo []string
|
||||
currentBullet atomic.Uint64
|
||||
}
|
||||
|
||||
func (ap *AmmoProvider) getIndex() uint64 {
|
||||
result := ap.currentBullet.Add(1)
|
||||
result := ap.currentBullet.Add(1)
|
||||
return result % uint64(len(ap.ammo))
|
||||
}
|
||||
|
||||
func (ap *AmmoProvider) GetBullet() string {
|
||||
for {
|
||||
res := ap.ammo[ap.getIndex()]
|
||||
if !strings.HasPrefix(res, "#") {
|
||||
return res
|
||||
}
|
||||
}
|
||||
for {
|
||||
res := ap.ammo[ap.getIndex()]
|
||||
if !strings.HasPrefix(res, "#") {
|
||||
return res
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func New(reader io.Reader) *AmmoProvider {
|
||||
|
||||
Reference in New Issue
Block a user