From 4764f56b4cc1e99e672a211c091335f5469a1538 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Fri, 14 Jun 2024 18:21:50 +0800 Subject: [PATCH] fix: deps issue --- backend/go.mod | 1 - trace | 1 - trace/.gitignore | 18 ++++++++++++++++++ trace/LICENSE | 29 +++++++++++++++++++++++++++++ trace/README.md | 2 ++ trace/go.mod | 5 +++++ trace/go.sum | 2 ++ trace/trace.go | 22 ++++++++++++++++++++++ 8 files changed, 78 insertions(+), 2 deletions(-) delete mode 160000 trace create mode 100644 trace/.gitignore create mode 100644 trace/LICENSE create mode 100644 trace/README.md create mode 100644 trace/go.mod create mode 100644 trace/go.sum create mode 100644 trace/trace.go diff --git a/backend/go.mod b/backend/go.mod index e5f04cc2..7de0fc4a 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -16,7 +16,6 @@ require github.com/crawlab-team/crawlab/core v0.0.0-20240614095218-7b4ee8399ab0 require ( dario.cat/mergo v1.0.0 // indirect - github.com/crawlab-team/crawlab/trace v0.1.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect diff --git a/trace b/trace deleted file mode 160000 index 188cd58f..00000000 --- a/trace +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 188cd58fec6e9cbee13060594f065bf811dea212 diff --git a/trace/.gitignore b/trace/.gitignore new file mode 100644 index 00000000..ec5b69a8 --- /dev/null +++ b/trace/.gitignore @@ -0,0 +1,18 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +.idea +.DS_Store \ No newline at end of file diff --git a/trace/LICENSE b/trace/LICENSE new file mode 100644 index 00000000..3c0946b9 --- /dev/null +++ b/trace/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Crawlab Team +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/trace/README.md b/trace/README.md new file mode 100644 index 00000000..168e0d40 --- /dev/null +++ b/trace/README.md @@ -0,0 +1,2 @@ +# go-trace +Trace stack tools diff --git a/trace/go.mod b/trace/go.mod new file mode 100644 index 00000000..368c0f2b --- /dev/null +++ b/trace/go.mod @@ -0,0 +1,5 @@ +module github.com/crawlab-team/crawlab/trace + +go 1.22 + +require github.com/ztrue/tracerr v0.4.0 diff --git a/trace/go.sum b/trace/go.sum new file mode 100644 index 00000000..ed0407a4 --- /dev/null +++ b/trace/go.sum @@ -0,0 +1,2 @@ +github.com/ztrue/tracerr v0.4.0 h1:vT5PFxwIGs7rCg9ZgJ/y0NmOpJkPCPFK8x0vVIYzd04= +github.com/ztrue/tracerr v0.4.0/go.mod h1:PaFfYlas0DfmXNpo7Eay4MFhZUONqvXM+T2HyGPpngk= diff --git a/trace/trace.go b/trace/trace.go new file mode 100644 index 00000000..52b59545 --- /dev/null +++ b/trace/trace.go @@ -0,0 +1,22 @@ +package trace + +import "github.com/ztrue/tracerr" + +func PrintError(err error) { + err = tracerr.Wrap(err) + if err != nil { + tracerr.Print(err) + } +} + +func TraceError(err error) error { + err = tracerr.Wrap(err) + if err != nil { + tracerr.Print(err) + } + return err +} + +func Error(err error) error { + return tracerr.Wrap(err) +}