Compare commits

...

4 commits

Author SHA1 Message Date
23495fde3b Add dependency to correctly read CPU quota inside containers
The dependency sets automatically GOMAXPROCS to match Linux container CPU quota.
2021-04-02 19:13:04 +02:00
479b9108ec Add copyright holder 2021-04-02 18:54:15 +02:00
1fd20f9b1c Replace travis setup with drone CI 2021-04-02 18:47:10 +02:00
52fc35ebbe Add go module file 2021-04-02 18:39:24 +02:00
7 changed files with 57 additions and 8 deletions

32
.drone.yml Normal file
View file

@ -0,0 +1,32 @@
kind: pipeline
name: default
steps:
- name: unit-test
image: golang
volumes:
- name: cache
path: /go
commands:
- go test -coverprofile=coverage.out -covermode=count ./...
- go tool cover -func=coverage.out | grep total
- name: race-test
image: golang
volumes:
- name: cache
path: /go
commands:
- go test -race ./...
- name: build
image: golang
volumes:
- name: deps
path: /go
commands:
- CGO_ENABLED=0 go build
volumes:
- name: cache
temp: {}

View file

@ -1,7 +0,0 @@
sudo: false
language: go
go:
- "1.13"
- "1.14"
notifications:
email: false

View file

@ -1,5 +1,6 @@
MIT License MIT License
Copyright (c) 2021 Augusto Dwenger J.
Copyright (c) 2018 Garrett Squire Copyright (c) 2018 Garrett Squire
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy

View file

@ -2,7 +2,7 @@
**D**efer **L**oop **L**inter **D**efer **L**oop **L**inter
[![Build Status](https://travis-ci.org/gsquire/dll.svg?branch=master)](https://travis-ci.org/gsquire/dll) [![Build Status](https://cloud.drone.io/api/badges/hamburghammer/dll/status.svg)](https://cloud.drone.io/hamburghammer/dll)
A simple linter to find `defer` statements inside of for loops in Go source. A simple linter to find `defer` statements inside of for loops in Go source.

2
dll.go
View file

@ -8,6 +8,8 @@ import (
"os" "os"
"runtime" "runtime"
"sync" "sync"
_ "go.uber.org/automaxprocs"
) )
type report struct { type report struct {

5
go.mod Normal file
View file

@ -0,0 +1,5 @@
module github.com/hamburghammer/dll
go 1.16
require go.uber.org/automaxprocs v1.4.0

16
go.sum Normal file
View file

@ -0,0 +1,16 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0=
go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=