refactor: replace magic numbers and string literals with constants
Some checks failed
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m34s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 49s
Go Revive Lint / lint (push) Successful in 46s
Run Gosec / tests (push) Successful in 1m21s
Go Build Multi-Platform / build (amd64, windows) (push) Failing after 49s
Go Build Multi-Platform / build (amd64, freebsd) (push) Successful in 1m4s
Go Build Multi-Platform / build (arm64, darwin) (push) Successful in 58s
Go Build Multi-Platform / build (arm, linux) (push) Successful in 1m1s
Go Build Multi-Platform / build (arm64, windows) (push) Successful in 41s
Go Build Multi-Platform / build (arm64, freebsd) (push) Failing after 4m51s
Go Build Multi-Platform / build (arm, windows) (push) Failing after 4m53s
Go Build Multi-Platform / build (arm64, linux) (push) Failing after 4m49s
Go Build Multi-Platform / build (amd64, linux) (push) Failing after 4m57s
Go Build Multi-Platform / build (arm, freebsd) (push) Failing after 4m55s
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 4m59s
Go Build Multi-Platform / Create Release (push) Has been skipped
Some checks failed
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m34s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 49s
Go Revive Lint / lint (push) Successful in 46s
Run Gosec / tests (push) Successful in 1m21s
Go Build Multi-Platform / build (amd64, windows) (push) Failing after 49s
Go Build Multi-Platform / build (amd64, freebsd) (push) Successful in 1m4s
Go Build Multi-Platform / build (arm64, darwin) (push) Successful in 58s
Go Build Multi-Platform / build (arm, linux) (push) Successful in 1m1s
Go Build Multi-Platform / build (arm64, windows) (push) Successful in 41s
Go Build Multi-Platform / build (arm64, freebsd) (push) Failing after 4m51s
Go Build Multi-Platform / build (arm, windows) (push) Failing after 4m53s
Go Build Multi-Platform / build (arm64, linux) (push) Failing after 4m49s
Go Build Multi-Platform / build (amd64, linux) (push) Failing after 4m57s
Go Build Multi-Platform / build (arm, freebsd) (push) Failing after 4m55s
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 4m59s
Go Build Multi-Platform / Create Release (push) Has been skipped
This commit is contained in:
@@ -78,20 +78,65 @@ const (
|
||||
SIXTY_SEVEN = 67
|
||||
|
||||
// Common Hex Constants
|
||||
HEX_0x00 = 0x00
|
||||
HEX_0x01 = 0x01
|
||||
HEX_0x02 = 0x02
|
||||
HEX_0x03 = 0x03
|
||||
HEX_0x04 = 0x04
|
||||
HEX_0x92 = 0x92
|
||||
HEX_0x93 = 0x93
|
||||
HEX_0xC2 = 0xC2
|
||||
HEX_0xC3 = 0xC3
|
||||
HEX_0xC4 = 0xC4
|
||||
HEX_0xD1 = 0xD1
|
||||
HEX_0xD2 = 0xD2
|
||||
HEX_0xFE = 0xFE
|
||||
HEX_0xFF = 0xFF
|
||||
|
||||
// Common Numeric Constants
|
||||
NUM_11 = 11
|
||||
NUM_100 = 100
|
||||
NUM_500 = 500
|
||||
NUM_1024 = 1024
|
||||
NUM_1064 = 1064
|
||||
NUM_4242 = 4242
|
||||
NUM_0700 = 0700
|
||||
|
||||
// Common Float Constants
|
||||
FLOAT_ZERO = 0.0
|
||||
FLOAT_0_001 = 0.001
|
||||
FLOAT_0_025 = 0.025
|
||||
FLOAT_0_1 = 0.1
|
||||
FLOAT_1_0 = 1.0
|
||||
FLOAT_1_75 = 1.75
|
||||
FLOAT_5_0 = 5.0
|
||||
FLOAT_1E9 = 1e9
|
||||
|
||||
// Common String Constants
|
||||
STR_LINK_ID = "link_id"
|
||||
STR_BYTES = "bytes"
|
||||
STR_FMT_HEX = "0x%02x"
|
||||
STR_LINK_ID = "link_id"
|
||||
STR_BYTES = "bytes"
|
||||
STR_FMT_HEX = "0x%02x"
|
||||
STR_FMT_HEX_LOW = "%x"
|
||||
STR_FMT_DEC = "%d"
|
||||
STR_TEST = "test"
|
||||
STR_LINK = "link"
|
||||
STR_ERROR = "error"
|
||||
STR_HASH = "hash"
|
||||
STR_NAME = "name"
|
||||
STR_TYPE = "type"
|
||||
STR_STORAGE = "storage"
|
||||
STR_PATH = "path"
|
||||
STR_COUNT = "count"
|
||||
STR_HOME = "HOME"
|
||||
STR_PUBLIC_KEY = "public_key"
|
||||
STR_TCP_CLIENT = "TCPClientInterface"
|
||||
STR_UDP = "udp"
|
||||
STR_UDP6 = "udp6"
|
||||
STR_TCP = "tcp"
|
||||
STR_ETH0 = "eth0"
|
||||
STR_INTERFACE = "interface"
|
||||
STR_PEER = "peer"
|
||||
STR_ADDR = "addr"
|
||||
STR_LINK_NOT_ACTIVE = "link not active"
|
||||
STR_INTERFACE_OFFLINE = "interface offline or detached"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user