Categorygithub.com/400f/sqlpassctxcheck
modulepackage
0.2.1
Repository: https://github.com/400f/sqlpassctxcheck.git
Documentation: pkg.go.dev

# README

sqlpassctxcheck

sqlpassctxcheck is a program for checking for sql module method call without ctx. Using this tool, you can avoid falling outside of distributed tracing by forgetting to pass the context.

Install

go install github.com/400f/sqlpassctxcheck/cmd/sqlpassctxcheck@latest

Usage

package main

import "database/sql"

func Call(db *sql.DB)  {
  rows, err := db.Query("SELECT * FROM foo")
  if err != nil {
    return err
  }

  // ...
}
$ go vet -vettool=(which sqlpassctxcheck) ./...

main.go:6:15 use (*database/sql.DB).QueryContext instead of (*database/sql.DB).Query

Develop

$ go test -v ./

# Packages

No description provided by the author
No description provided by the author

# Variables

No description provided by the author