Skip to content

Commit

Permalink
build: add gofmt to format make target (#252)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <[email protected]>
  • Loading branch information
wolf31o2 authored Dec 20, 2024
1 parent 72d05a1 commit fa4ea3b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ mod-tidy:
clean:
rm -f $(BINARIES)

format:
format: mod-tidy
go fmt ./...
gofmt -s -w $(GO_FILES)

golines:
golines -w --ignore-generated --chain-split-dots --max-len=80 --reformat-tags .
Expand Down
8 changes: 4 additions & 4 deletions internal/config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func GetAvailableProfiles() []string {
var Profiles = map[string]Profile{
// This (default) profile corresponds to the values specified in:
// https://github.com/blinklabs-io/cardano-dns/blob/main/README.md
"cardano-preprod-testing": Profile{
"cardano-preprod-testing": {
Network: "preprod",
Tld: "cardano",
PolicyId: "6af60c2a7a06551ef09b3810a41d086b26ca26f926d22e462103194d",
ScriptAddress: "addr_test1vr75xezmpxastymx985l3gamuxrwqdwcfrcnjlygs55aynsqu3edq",
InterceptSlot: 50844079,
InterceptHash: "81325118471fddb00a20327572b371aee7cce13b846a18500d011b9cefd2a34c",
},
"ada-preprod": Profile{
"ada-preprod": {
Network: "preprod",
Tld: "ada",
PolicyId: "32c89cdb9c73b904ae0fd230770ee082d6e5fe090b20eaa08ee70dd3",
Expand All @@ -57,7 +57,7 @@ var Profiles = map[string]Profile{
InterceptSlot: 65308876,
InterceptHash: "435703531e57bfe9b4d309e7360efc43e04d06531c9393530c57bebf029ec634",
},
"hydra-preprod": Profile{
"hydra-preprod": {
Network: "preprod",
Tld: "hydra",
PolicyId: "f5f8228a4bd56704ad3c612ecc74e5d2e5d15292b8cae3aaa8065fc1",
Expand All @@ -66,7 +66,7 @@ var Profiles = map[string]Profile{
InterceptSlot: 67799029,
InterceptHash: "4815dae9cd8f492ab51b109ba87d091ae85a0999af33ac459d8504122cb911f7",
},
"auto-preprod": Profile{
"auto-preprod": {
Network: "preprod",
PolicyId: "63cdaef8b84702282c3454ae130ada94a9b200e32be21abd47fc636b",
DiscoveryAddress: "addr_test1xrhqrug2hnc9az4ru02kp9rlfcppl464gl4yc8s8jm5p8kygc3uvcfh3r3kaa5gyk5l2vgdl8vj8cstslf4w2ajuy0wsp5fm89",
Expand Down
6 changes: 5 additions & 1 deletion internal/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ func Start() error {
go startListener(serverTcp)
// TLS listener
if cfg.Tls.CertFilePath != "" && cfg.Tls.KeyFilePath != "" {
listenTlsAddr := fmt.Sprintf("%s:%d", cfg.Dns.ListenAddress, cfg.Dns.ListenTlsPort)
listenTlsAddr := fmt.Sprintf(
"%s:%d",
cfg.Dns.ListenAddress,
cfg.Dns.ListenTlsPort,
)
serverTls := &dns.Server{
Addr: listenTlsAddr,
Net: "tcp-tls",
Expand Down
5 changes: 4 additions & 1 deletion internal/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ func Configure() {
if a.Key == slog.TimeKey {
// Format the time attribute to use RFC3339 or your custom format
// Rename the time key to timestamp
return slog.String("timestamp", a.Value.Time().Format(time.RFC3339))
return slog.String(
"timestamp",
a.Value.Time().Format(time.RFC3339),
)
}
return a
},
Expand Down

0 comments on commit fa4ea3b

Please sign in to comment.