Skip to content

Commit

Permalink
[Cosmetic]: Municipal Inflation Cache: update code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pbukva committed Aug 8, 2023
1 parent df4d3c3 commit ebede9b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions x/mint/cache/municipal_inflation_cahe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ type MunicipalInflationCache struct {
}

var (

Check failure on line 21 in x/mint/cache/municipal_inflation_cahe.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofumpt`-ed (gofumpt)
// NOTE(pb): This is *NOT* thread safe.
// However, in our case, this global variable is by design
// *NOT* supposed to be accessed simultaneously in multiple
// different threads, or in global scope somewhere else.
// Once such requirements arise, concept of this global variable
// needs to be changed to something what is thread safe.
// GMunicipalInflationCache Thread safety:
// As the things stand now from design & impl. perspective:
// 1. This global variable is supposed to be initialised(= its value set)
// just *ONCE* here, at this place,
// 2. This global variable is *NOT* used anywhere else in the initialisation
// context of the *global scope* - e.g. as input for initialisation of
// another global variable, etc. ...
// 3. All *exported* methods of `MunicipalInflationCache` type *ARE* thread safe,
// and so can be called from anywhere, *EXCEPT* from the initialisation context
// of the global scope(implication of the point 2 above)!
GMunicipalInflationCache = MunicipalInflationCache{}
)

Expand Down

0 comments on commit ebede9b

Please sign in to comment.