summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/sirupsen/logrus/magefile.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-04-03 19:16:46 +0200
committerGitHub <noreply@github.com>2021-04-03 19:16:46 +0200
commit21eb37e471c338a90f2e23c86106f7e49e2d1196 (patch)
treee7d1cfa89f31fcf0578edae7727f2230bba744a2 /vendor/github.com/sirupsen/logrus/magefile.go
parentd3b60cc445e5871971b543fde9483dba3924bf68 (diff)
downloadmatterbridge-msglm-21eb37e471c338a90f2e23c86106f7e49e2d1196.tar.gz
matterbridge-msglm-21eb37e471c338a90f2e23c86106f7e49e2d1196.tar.bz2
matterbridge-msglm-21eb37e471c338a90f2e23c86106f7e49e2d1196.zip
Update vendor (#1446)
* Update vendor * Use upstream emoji lib again
Diffstat (limited to 'vendor/github.com/sirupsen/logrus/magefile.go')
-rw-r--r--vendor/github.com/sirupsen/logrus/magefile.go77
1 files changed, 0 insertions, 77 deletions
diff --git a/vendor/github.com/sirupsen/logrus/magefile.go b/vendor/github.com/sirupsen/logrus/magefile.go
deleted file mode 100644
index 9aa60393..00000000
--- a/vendor/github.com/sirupsen/logrus/magefile.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// +build mage
-
-package main
-
-import (
- "encoding/json"
- "fmt"
- "os"
- "path"
-
- "github.com/magefile/mage/mg"
- "github.com/magefile/mage/sh"
-)
-
-// getBuildMatrix returns the build matrix from the current version of the go compiler
-func getBuildMatrix() (map[string][]string, error) {
- jsonData, err := sh.Output("go", "tool", "dist", "list", "-json")
- if err != nil {
- return nil, err
- }
- var data []struct {
- Goos string
- Goarch string
- }
- if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
- return nil, err
- }
-
- matrix := map[string][]string{}
- for _, v := range data {
- if val, ok := matrix[v.Goos]; ok {
- matrix[v.Goos] = append(val, v.Goarch)
- } else {
- matrix[v.Goos] = []string{v.Goarch}
- }
- }
-
- return matrix, nil
-}
-
-func CrossBuild() error {
- matrix, err := getBuildMatrix()
- if err != nil {
- return err
- }
-
- for os, arches := range matrix {
- for _, arch := range arches {
- env := map[string]string{
- "GOOS": os,
- "GOARCH": arch,
- }
- if mg.Verbose() {
- fmt.Printf("Building for GOOS=%s GOARCH=%s\n", os, arch)
- }
- if err := sh.RunWith(env, "go", "build", "./..."); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-func Lint() error {
- gopath := os.Getenv("GOPATH")
- if gopath == "" {
- return fmt.Errorf("cannot retrieve GOPATH")
- }
-
- return sh.Run(path.Join(gopath, "bin", "golangci-lint"), "run", "./...")
-}
-
-// Run the test suite
-func Test() error {
- return sh.RunWith(map[string]string{"GORACE": "halt_on_error=1"},
- "go", "test", "-race", "-v", "./...")
-}