Skip to content

Commit

Permalink
basic go repo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
candinu committed Mar 18, 2023
0 parents commit 9ef8501
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
*.swp
*.log
bin/
109 changes: 109 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# This file contains all available configuration options
# with their default values (in comments).
#
# This file is not a configuration example,
# it contains the exhaustive configuration with explanations of the options.

# Options for analysis running.
run:
# The default concurrency value is the number of available CPU.
concurrency: 4

# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m

# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 2

# Include test files or not.
# Default: true
tests: false

# List of build tags, all linters use it.
# Default: [].
build-tags:
- mytag

# Which dirs to skip: issues from them won't be reported.
# Can use regexp here: `generated.*`, regexp is applied on full path.
# Default value is empty list,
# but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-dirs:
- src/external_libs
- autogenerated_by_my_lib

# Enables skipping of directories:
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
# Default: true
skip-dirs-use-default: false

# Which files to skip: they will be analyzed, but issues from them won't be reported.
# Default value is empty list,
# but there is no need to include all autogenerated files,
# we confidently recognize autogenerated files.
# If it's not please let us know.
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-files:
- ".*\\.my\\.go$"
- lib/bad.go

# If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
#
# Allowed values: readonly|vendor|mod
# By default, it isn't set.
modules-download-mode: readonly

# Allow multiple parallel golangci-lint instances running.
# If false (default) - golangci-lint acquires file lock on start.
allow-parallel-runners: false

# Define the Go version limit.
# Mainly related to generics support in go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17
go: '1.18'


linters:
enable-all: true
disable:
- golint
- exhaustivestruct
- scopelint
- interfacer
- maligned
- bodyclose
- contextcheck
- nilerr
- noctx
- rowserrcheck
- sqlclosecheck
- structcheck
- tparallel
- unparam
- wastedassign
- wsl
- varnamelen
- gomnd
- exhaustruct
- gochecknoglobals
- nlreturn
- godox

linters-settings:
lll:
line-length: 160
tagliatelle:
case:
use-field-name: true
rules:
json: snake
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
VERSION=$(shell git tag --sort=-version:refname | head -1)
SHA=$(shell git rev-parse --short HEAD)

LDFLAGS=-X 'main.version=$(VERSION)' -X 'main.sha=$(SHA)'

.PHONY: setup build build_linux test run clean all

.DEFAULT_GOAL: default

default: build test

setup:
mkdir -p bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.46.2

install:
go install --ldflags="${LDFLAGS}" ./cmd/rom/

lint: setup
./bin/golangci-lint run

test: lint
go test ./...

3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/scalescape/dolores

go 1.19
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "log"

func main() {
log.Println("dolores")
}
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dolores

Simplifying secrets management

0 comments on commit 9ef8501

Please sign in to comment.