Equals returns whether the tokens are equal to the input ones.
(other Tokens)
| 18 | |
| 19 | // Equals returns whether the tokens are equal to the input ones. |
| 20 | func (t Tokens) Equals(other Tokens) bool { |
| 21 | if len(t) != len(other) { |
| 22 | return false |
| 23 | } |
| 24 | |
| 25 | mine := t |
| 26 | sort.Sort(mine) |
| 27 | sort.Sort(other) |
| 28 | |
| 29 | for i := 0; i < len(mine); i++ { |
| 30 | if mine[i] != other[i] { |
| 31 | return false |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | return true |
| 36 | } |
| 37 | |
| 38 | // StoreToFile stores the tokens in the given directory. |
| 39 | func (t Tokens) StoreToFile(tokenFilePath string) error { |
no outgoing calls