Skip to content

Commit 7774cd2

Browse files
authored
perf: field alignment on structs (#526)
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
1 parent c321f28 commit 7774cd2

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

input/chainsync/plugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ import (
2727

2828
var cmdlineOptions struct {
2929
network string
30-
networkMagic uint
3130
address string
3231
socketPath string
32+
intersectPoint string
33+
networkMagic uint
34+
delayConfirmations uint
3335
ntcTcp bool
3436
intersectTip bool
35-
intersectPoint string
3637
includeCbor bool
3738
autoReconnect bool
38-
delayConfirmations uint
3939
}
4040

4141
func init() {

input/chainsync/transaction_output.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import (
3030
// ResolvedTransactionOutput represents a concrete implementation of the TransactionOutput interface
3131
type ResolvedTransactionOutput struct {
3232
AddressField common.Address `json:"address"`
33-
AmountField uint64 `json:"amount"`
3433
AssetsField *common.MultiAsset[uint64] `json:"assets,omitempty"`
34+
AmountField uint64 `json:"amount"`
3535
}
3636

3737
func ExtractAssetDetailsFromMatch(

internal/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ const (
3030
)
3131

3232
type Config struct {
33-
Api ApiConfig `yaml:"api"`
34-
Logging LoggingConfig `yaml:"logging"`
35-
Debug DebugConfig `yaml:"debug"`
3633
Plugin map[string]map[string]map[any]any `yaml:"plugins"`
34+
Logging LoggingConfig `yaml:"logging"`
3735
ConfigFile string `yaml:"-"`
3836
Input string `yaml:"input" envconfig:"INPUT"`
3937
Output string `yaml:"output" envconfig:"OUTPUT"`
4038
KupoUrl string `yaml:"kupo_url" envconfig:"KUPO_URL"`
39+
Api ApiConfig `yaml:"api"`
40+
Debug DebugConfig `yaml:"debug"`
4141
Version bool `yaml:"-"`
4242
}
4343

output/push/fcm/message.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ type Message struct {
3232
}
3333

3434
type MessageContent struct {
35-
Token string `json:"token"`
3635
Notification *NotificationContent `json:"notification,omitempty"`
3736
Data map[string]any `json:"data,omitempty"`
37+
Token string `json:"token"`
3838
}
3939

4040
type NotificationContent struct {

pipeline/pipeline.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ import (
2424
)
2525

2626
type Pipeline struct {
27-
inputs []plugin.Plugin
28-
filters []plugin.Plugin
29-
outputs []plugin.Plugin
3027
filterChan chan event.Event
3128
outputChan chan event.Event
3229
errorChan chan error
3330
doneChan chan bool
31+
inputs []plugin.Plugin
32+
filters []plugin.Plugin
33+
outputs []plugin.Plugin
3434
wg sync.WaitGroup
3535
stopOnce sync.Once
3636
}

plugin/option.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ const (
3232
)
3333

3434
type PluginOption struct {
35+
DefaultValue any
36+
Dest any
3537
Name string
36-
Type PluginOptionType
3738
CustomEnvVar string
3839
CustomFlag string
3940
Description string
40-
DefaultValue any
41-
Dest any
41+
Type PluginOptionType
4242
}
4343

4444
func (p *PluginOption) AddToFlagSet(

plugin/register.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ func PluginTypeName(pluginType PluginType) string {
4141
}
4242

4343
type PluginEntry struct {
44-
Type PluginType
44+
NewFromOptionsFunc func() Plugin
4545
Name string
4646
Description string
4747
Options []PluginOption
48-
NewFromOptionsFunc func() Plugin
48+
Type PluginType
4949
}
5050

5151
var pluginEntries []PluginEntry

0 commit comments

Comments
 (0)