Skip to content

Commit

Permalink
make counter private
Browse files Browse the repository at this point in the history
  • Loading branch information
edison committed Jun 3, 2020
1 parent a4b3389 commit 65dea65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions stmt/OracleStmtIndexConvertImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type OracleStmtIndexConvertImpl struct {
sync.RWMutex
Counter int
counter int
}

func (it *OracleStmtIndexConvertImpl) Convert() string {
Expand All @@ -17,11 +17,11 @@ func (it *OracleStmtIndexConvertImpl) Convert() string {
func (it *OracleStmtIndexConvertImpl) Inc() {
it.Lock()
defer it.Unlock()
it.Counter++
it.counter++
}

func (it *OracleStmtIndexConvertImpl) Get() int {
it.RLock()
defer it.RUnlock()
return it.Counter
return it.counter
}
6 changes: 3 additions & 3 deletions stmt/PostgreStmtIndexConvertImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import (

type PostgreStmtIndexConvertImpl struct {
sync.RWMutex
Counter int
counter int
}

func (p *PostgreStmtIndexConvertImpl) Inc() {
p.Lock()
defer p.Unlock()
p.Counter++
p.counter++
}

func (p *PostgreStmtIndexConvertImpl) Get() int {
p.RLock()
defer p.RUnlock()
return p.Counter
return p.counter
}

func (p *PostgreStmtIndexConvertImpl) Convert() string {
Expand Down

0 comments on commit 65dea65

Please sign in to comment.