diff --git a/bridge-history-api/abi/backend_abi.go b/bridge-history-api/abi/backend_abi.go index c4615862ff..70c650c959 100644 --- a/bridge-history-api/abi/backend_abi.go +++ b/bridge-history-api/abi/backend_abi.go @@ -375,7 +375,7 @@ type L1CommitBatchEvent struct { BatchHash common.Hash } -// IScrollChainBlockContext is an auto generated low-level Go binding around an user-defined struct. +// IScrollChainBlockContext is an auto generated low-level Go binding around a user-defined struct. type IScrollChainBlockContext struct { BlockHash common.Hash ParentHash common.Hash diff --git a/bridge-history-api/crossmsg/batch_info_fetcher.go b/bridge-history-api/crossmsg/batch_info_fetcher.go index 83a9472536..9ac147ed52 100644 --- a/bridge-history-api/crossmsg/batch_info_fetcher.go +++ b/bridge-history-api/crossmsg/batch_info_fetcher.go @@ -100,8 +100,8 @@ func (b *BatchInfoFetcher) fetchBatchInfo() error { } for from := startHeight; number >= from; from += fetchLimit { to := from + fetchLimit - 1 - // number - confirmation can never less than 0 since the for loop condition - // but watch out the overflow + // number - confirmation can never be less than 0 since the for loop condition + // but watch out for the overflow if to > number { to = number } diff --git a/bridge-history-api/crossmsg/cross_msg_fetcher.go b/bridge-history-api/crossmsg/cross_msg_fetcher.go index 7c57516732..2109e8b9ca 100644 --- a/bridge-history-api/crossmsg/cross_msg_fetcher.go +++ b/bridge-history-api/crossmsg/cross_msg_fetcher.go @@ -135,7 +135,7 @@ func (c *MsgFetcher) forwardFetchAndSaveMissingEvents(confirmation uint64) { if to > number { to = number } - // watch for overflow here, tho its unlikely to happen + // watch for overflow here, though its unlikely to happen err := c.worker.F(c.ctx, c.client, c.db, int64(from), int64(to), c.addressList) if err != nil { log.Error(fmt.Sprintf("%s: failed!", c.worker.Name), "err", err) diff --git a/bridge-history-api/crossmsg/messageproof/withdraw_trie.go b/bridge-history-api/crossmsg/messageproof/withdraw_trie.go index a5e37ab4aa..8e2ff1d9ac 100644 --- a/bridge-history-api/crossmsg/messageproof/withdraw_trie.go +++ b/bridge-history-api/crossmsg/messageproof/withdraw_trie.go @@ -6,7 +6,7 @@ import ( "bridge-history-api/utils" ) -// MaxHeight is the maximum possible height of withdraw trie +// MaxHeight is the maximum possible height of withdrawal trie const MaxHeight = 40 // WithdrawTrie is an append only merkle trie diff --git a/bridge-history-api/observability/ginmetrics/middleware.go b/bridge-history-api/observability/ginmetrics/middleware.go index 79f74bee0d..462ce7f38e 100644 --- a/bridge-history-api/observability/ginmetrics/middleware.go +++ b/bridge-history-api/observability/ginmetrics/middleware.go @@ -40,7 +40,7 @@ func (m *Monitor) UseWithoutExposingEndpoint(r gin.IRoutes) { } // Expose adds metric path to a given router. -// The router can be different with the one passed to UseWithoutExposingEndpoint. +// The router can be different from the one passed to UseWithoutExposingEndpoint. // This allows to expose metrics on different port. func (m *Monitor) Expose(r gin.IRoutes) { r.GET(m.metricPath, func(ctx *gin.Context) { diff --git a/bridge-history-api/observability/ginmetrics/types.go b/bridge-history-api/observability/ginmetrics/types.go index 113a580850..b54398e1b9 100644 --- a/bridge-history-api/observability/ginmetrics/types.go +++ b/bridge-history-api/observability/ginmetrics/types.go @@ -39,7 +39,7 @@ var ( } ) -// Monitor is an object that uses to set gin server monitor. +// Monitor is an object that is used to set gin server monitor. type Monitor struct { slowTime int32 metricPath string @@ -63,7 +63,7 @@ func GetMonitor(reg prometheus.Registerer) *Monitor { return monitor } -// GetMetric used to get metric object by metric_name. +// GetMetric is used to get metric object by metric_name. func (m *Monitor) GetMetric(name string) *Metric { if metric, ok := m.metrics[name]; ok { return metric diff --git a/bridge-history-api/observability/server.go b/bridge-history-api/observability/server.go index 7f5352338e..e51bd004b7 100644 --- a/bridge-history-api/observability/server.go +++ b/bridge-history-api/observability/server.go @@ -19,7 +19,7 @@ import ( "bridge-history-api/utils" ) -// Server starts the metrics server on the given address, will be closed when the given +// Server starts the metrics server on the given address, which will be closed when the given // context is canceled. func Server(c *cli.Context, db *gorm.DB) { if !c.Bool(utils.MetricsEnabled.Name) { diff --git a/build/.golangci.yml b/build/.golangci.yml index 6b334da1ff..b6d55caea8 100644 --- a/build/.golangci.yml +++ b/build/.golangci.yml @@ -1,7 +1,7 @@ # Source: https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml # options for analysis running run: - # default concurrency is a available CPU number + # default concurrency is the available CPU number concurrency: 4 # timeout for analysis, e.g. 30s, 5m, default is 1m diff --git a/common/cmd/cmd_app.go b/common/cmd/cmd_app.go index 91b042db00..f9eb8c1acb 100644 --- a/common/cmd/cmd_app.go +++ b/common/cmd/cmd_app.go @@ -48,7 +48,7 @@ func (c *Cmd) WaitExit() { select { case err = <-c.ErrChan: if err != nil { - fmt.Printf("%s appear error durning running, err: %v\n", c.name, err) + fmt.Printf("%s appear error during running, err: %v\n", c.name, err) } default: <-time.After(time.Millisecond * 500)