apply gofmt
This commit is contained in:
parent
d11230aaf8
commit
8161f48c15
3 changed files with 8 additions and 7 deletions
|
@ -44,14 +44,14 @@ func (c Contact) String() string {
|
||||||
|
|
||||||
func (c Contact) MarshalJSON() ([]byte, error) {
|
func (c Contact) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(&struct {
|
return json.Marshal(&struct {
|
||||||
ID string
|
ID string
|
||||||
IP string
|
IP string
|
||||||
Port int
|
Port int
|
||||||
PeerPort int
|
PeerPort int
|
||||||
}{
|
}{
|
||||||
ID: c.ID.Hex(),
|
ID: c.ID.Hex(),
|
||||||
IP: c.IP.String(),
|
IP: c.IP.String(),
|
||||||
Port: c.Port,
|
Port: c.Port,
|
||||||
PeerPort: c.PeerPort,
|
PeerPort: c.PeerPort,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ type RpcIterativeFindValueArgs struct {
|
||||||
type RpcIterativeFindValueResult struct {
|
type RpcIterativeFindValueResult struct {
|
||||||
Contacts []Contact
|
Contacts []Contact
|
||||||
FoundValue bool
|
FoundValue bool
|
||||||
Values []Contact
|
Values []Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rpc *rpcReceiver) IterativeFindValue(r *http.Request, args *RpcIterativeFindValueArgs, result *RpcIterativeFindValueResult) error {
|
func (rpc *rpcReceiver) IterativeFindValue(r *http.Request, args *RpcIterativeFindValueArgs, result *RpcIterativeFindValueResult) error {
|
||||||
|
|
|
@ -21,6 +21,7 @@ func NormalizeName(s string) string {
|
||||||
c := cases.Fold()
|
c := cases.Fold()
|
||||||
return c.String(norm.NFD.String(s))
|
return c.String(norm.NFD.String(s))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReverseBytesInPlace reverse the bytes. thanks, Satoshi 😒
|
// ReverseBytesInPlace reverse the bytes. thanks, Satoshi 😒
|
||||||
func ReverseBytesInPlace(s []byte) {
|
func ReverseBytesInPlace(s []byte) {
|
||||||
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
|
||||||
|
|
Loading…
Reference in a new issue