From 371ef5d12ce4de8c54ab090fa40716db7ce51e2d Mon Sep 17 00:00:00 2001 From: kumfo Date: Mon, 15 Jul 2024 17:55:53 +0800 Subject: [PATCH] fix(util): runtime.Caller in go1.19 `skip` param error, `skip` in go1.19 is 0, in go1.21 is 1 --- util/go.mod | 2 +- util/util.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/go.mod b/util/go.mod index 27a8657e..732b4c99 100644 --- a/util/go.mod +++ b/util/go.mod @@ -1,5 +1,5 @@ module github.com/apache/incubator-answer-plugins/util -go 1.21.4 +go 1.19 require gopkg.in/yaml.v3 v3.0.1 diff --git a/util/util.go b/util/util.go index 655aa21e..b2d7d6be 100644 --- a/util/util.go +++ b/util/util.go @@ -36,7 +36,7 @@ type Info struct { } func (c *Info) GetInfo() *Info { - _, filename, _, _ := runtime.Caller(0) + _, filename, _, _ := runtime.Caller(1) wd := filepath.Dir(filename) yamlFilePath := filepath.Join(wd, "info.yaml")