MCPcopy Index your code
hub / github.com/coder/coder / aliasedHelperMisuse

Method aliasedHelperMisuse

scripts/intxcheck/testdata/src/example/example.go:78–84  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

76}
77
78func (s *Server) aliasedHelperMisuse(ctx context.Context) error {
79 return s.db.InTx(func(tx Store) error {
80 alias := s
81 alias.getConfig(ctx) // want "call to 'alias[.]getConfig' inside InTx uses outer store 's[.]db'; pass 'tx' through the helper or hoist the call"
82 return nil
83 }, nil)
84}
85
86func (s *Server) goFuncLiteralMisuse(ctx context.Context) error {
87 return s.db.InTx(func(tx Store) error {

Callers

nothing calls this directly

Calls 2

getConfigMethod · 0.80
InTxMethod · 0.65

Tested by

no test coverage detected