Skip to content

Commit

Permalink
Fix CI, deprecated stuff and more (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
HnH authored Feb 18, 2024
1 parent 4fb4ffa commit 7c2c8fc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 33 deletions.
18 changes: 0 additions & 18 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ clean: ## clean working tree

lint: ## Run the linters
go vet ./...
revive -formatter friendly -config .circleci/revive.toml ./...
revive -formatter friendly -config revive.toml ./...
gosec -exclude=G104 -tests ./...

test: ## Run tests
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![CircleCI](https://circleci.com/gh/HnH/qry/tree/master.svg?style=svg&circle-token=cd6ef5c602e0f89a80488349a1e4fbe034b8d717)](https://circleci.com/gh/HnH/qry/tree/master)
[![buddy pipeline](https://eu.buddy.works/treinis/qry/pipelines/pipeline/191916/badge.svg?token=b46003623254cc1f4e162f3911b6075d87b9121676c88ffebfbe34d562d75d96 "buddy pipeline")](https://eu.buddy.works/treinis/qry/pipelines/pipeline/191916)
[![codecov](https://codecov.io/gh/HnH/qry/branch/master/graph/badge.svg)](https://codecov.io/gh/HnH/qry)
[![Go Report Card](https://goreportcard.com/badge/github.com/HnH/qry)](https://goreportcard.com/report/github.com/HnH/qry)
[![Godoc Reference](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/HnH/qry)
Expand All @@ -13,7 +13,7 @@

# Installation

`go get -u github.com/HnH/qry/cmd/qry-gen`
`go install github.com/HnH/qry/cmd/qry-gen@latest`

# Usage

Expand Down
8 changes: 4 additions & 4 deletions cmd/qry-gen/gen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// main
package main

import (
Expand All @@ -6,7 +7,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -61,7 +61,7 @@ func gen(cfg config) (err error) {
return
}

// passing trough gofmt
// passing through gofmt
if cfg.fmt {
if err = format(b); err != nil {
return
Expand All @@ -75,7 +75,7 @@ func gen(cfg config) (err error) {
}

// Output to file
if err = ioutil.WriteFile(fmt.Sprintf("%s/%s", cfg.pkg, cfg.out), b.Bytes(), os.ModePerm); err != nil {
if err = os.WriteFile(fmt.Sprintf("%s/%s", cfg.pkg, cfg.out), b.Bytes(), os.ModePerm); err != nil {
err = fmt.Errorf("cannot write to output file [%s/%s]", cfg.pkg, cfg.out)
return
}
Expand All @@ -101,7 +101,7 @@ func loadSql(cfg config) (b *bytes.Buffer, err error) {
return
}

b.WriteString(fmt.Sprintf("package %s\n\n ^// Code generated .* DO NOT EDIT.$ \n\n", filepath.Base(cfg.pkg)))
b.WriteString(fmt.Sprintf("package %s\n\n// Code generated .* DO NOT EDIT.\n\n", filepath.Base(cfg.pkg)))
}

b.WriteString("const (\n")
Expand Down
3 changes: 1 addition & 2 deletions cmd/qry-gen/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"bytes"
"io/ioutil"
"os"
"testing"
)
Expand Down Expand Up @@ -31,7 +30,7 @@ func TestGen(t *testing.T) {
t.Errorf("unexpected error: %s", err.Error())
}

b, err := ioutil.ReadFile(cfg.pkg + cfg.out)
b, err := os.ReadFile(cfg.pkg + cfg.out)
if err != nil {
t.Errorf("unexpected error: %s", err.Error())
}
Expand Down
6 changes: 0 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
module github.com/HnH/qry

go 1.15

require (
github.com/gookit/color v1.2.8 // indirect
github.com/securego/gosec/v2 v2.4.0 // indirect
golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65 // indirect
)
File renamed without changes.

0 comments on commit 7c2c8fc

Please sign in to comment.