1234567891011121314151617181920212223242526 |
- // Copyright (c) 2013-2017 The btcsuite developers
- // Copyright (c) 2017 The Decred developers
- // Copyright (c) 2019 Caleb James DeLisle
- // Use of this source code is governed by an ISC
- // license that can be found in the LICENSE file.
- package main
- // directionString is a helper function that returns a string that represents
- // the direction of a connection (inbound or outbound).
- func directionString(inbound bool) string {
- if inbound {
- return "inbound"
- }
- return "outbound"
- }
- // pickNoun returns the singular or plural form of a noun depending
- // on the count n.
- func pickNoun(n uint64, singular, plural string) string {
- if n == 1 {
- return singular
- }
- return plural
- }
|