mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-20 16:36:31 +00:00
linting: add to Makefile & do some fixes
This commit is contained in:
10
common/os.go
10
common/os.go
@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -17,7 +18,7 @@ var (
|
||||
func TrapSignal(cb func()) {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
signal.Notify(c, os.Kill)
|
||||
signal.Notify(c, syscall.SIGTERM)
|
||||
go func() {
|
||||
for sig := range c {
|
||||
fmt.Printf("captured %v, exiting...\n", sig)
|
||||
@ -83,12 +84,7 @@ func MustReadFile(filePath string) []byte {
|
||||
}
|
||||
|
||||
func WriteFile(filePath string, contents []byte, mode os.FileMode) error {
|
||||
err := ioutil.WriteFile(filePath, contents, mode)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// fmt.Printf("File written to %v.\n", filePath)
|
||||
return nil
|
||||
return ioutil.WriteFile(filePath, contents, mode)
|
||||
}
|
||||
|
||||
func MustWriteFile(filePath string, contents []byte, mode os.FileMode) {
|
||||
|
Reference in New Issue
Block a user