Skip to content

Instantly share code, notes, and snippets.

@liues1992
liues1992 / pre-commit
Created September 3, 2018 06:35
golang basic pre-commit check, including gofmt goimports golint
#!/bin/sh
# Partly copy from https://tip.golang.org/misc/git/pre-commit
# Copyright 2012 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# git gofmt pre-commit hook
#
# To use, store as .git/hooks/pre-commit inside your repository and make sure
# it has execute permissions.