Skip to content

Commit ea3d820

Browse files
authored
micro-optimization: use int8 for enums (#338)
1 parent 59dc591 commit ea3d820

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

asciiconverter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"io"
66
)
77

8-
type convertMode int
8+
type convertMode int8
99

1010
const (
1111
convertModeToCRLF convertMode = iota

client_handler.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
// HASHAlgo is the enumerable that represents the supported HASH algorithms
17-
type HASHAlgo int
17+
type HASHAlgo int8
1818

1919
// Supported hash algorithms
2020
const (
@@ -26,7 +26,7 @@ const (
2626
)
2727

2828
// TransferType is the enumerable that represents the supported transfer types
29-
type TransferType int
29+
type TransferType int8
3030

3131
// Supported transfer type
3232
const (
@@ -35,7 +35,7 @@ const (
3535
)
3636

3737
// DataChannel is the enumerable that represents the data channel (active or passive)
38-
type DataChannel int
38+
type DataChannel int8
3939

4040
// Supported data channel types
4141
const (

driver.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ type PortRange struct {
208208
type PublicIPResolver func(ClientContext) (string, error)
209209

210210
// TLSRequirement is the enumerable that represents the supported TLS mode
211-
type TLSRequirement int
211+
type TLSRequirement int8
212212

213213
// TLS modes
214214
const (
@@ -219,7 +219,7 @@ const (
219219

220220
// DataConnectionRequirement is the enumerable that represents the supported
221221
// protection mode for data channels
222-
type DataConnectionRequirement int
222+
type DataConnectionRequirement int8
223223

224224
// Supported data connection requirements
225225
const (

driver_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/spf13/afero"
1818
)
1919

20-
type tlsVerificationReply int
20+
type tlsVerificationReply int8
2121

2222
const (
2323
// tls certificate is ok but a password is required too

0 commit comments

Comments
 (0)