Coder Social home page Coder Social logo

execinquery's Introduction

execinquery - a simple query string checker in Query function

Go Matrix Go lint MIT License

About

execinquery is a linter about query string checker in Query function which reads your Go src files and warnings it finds.

Installation

go install github.com/lufeee/execinquery/cmd/execinquery

Usage

package main

import (
        "database/sql"
        "log"
)

func main() {
        db, err := sql.Open("mysql", "test:test@tcp(test:3306)/test")
        if err != nil {
                log.Fatal("Database Connect Error: ", err)
        }
        defer db.Close()

        test := "a"
        _, err = db.Query("Update * FROM hoge where id = ?", test)
        if err != nil {
                log.Fatal("Query Error: ", err)
        }

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

# command-line-arguments
./a.go:16:11: Use Exec instead of Query to execute `UPDATE` query

CI

CircleCI

- run:
    name: install execinquery
    command: go install github.com/lufeee/execinquery

- run:
    name: run execinquery
    command: go vet -vettool=`which execinquery` ./...

GitHub Actions

- name: install execinquery
  run: go install github.com/lufeee/execinquery

- name: run execinquery
  run: go vet -vettool=`which execinquery` ./...

License

MIT license.


execinquery's People

Contributors

1uf3 avatar ldez avatar rski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.