Skip to content

Commit 3f7f151

Browse files
authored
Merge pull request #788 from ydb-platform/stack-record
* Added `sugar.StackRecord()` helper for stringification of current f…
2 parents 2a21b38 + 0a863a3 commit 3f7f151

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Added `sugar.StackRecord()` helper for stringification of current file path and line
2+
13
## v3.48.6
24
* Added builder for topic reader message (usable for tests)
35

@@ -82,7 +84,7 @@
8284
* Extend `scheme.Client` interface with method `Database`
8385
* Removed `driver.ResultNoRows` in `internal/xsql`
8486
* Added `ydb.{WithTablePathPrefix,WithAutoDeclare,WithPositionalArgs,WithNumericalArgs}` query modifiers options
85-
* Supported binding parameters for `database/sql` driver over connector option `ydb.WithAutoBind()` and connection string params `go_auto_bind={origin,table_path_prefix(path),declare,numeric,positional}`
87+
* Supported binding parameters for `database/sql` driver over connector option `ydb.WithAutoBind()` and connection string params `go_auto_bind={table_path_prefix(path),declare,numeric,positional}`
8688
* Added `testutil.QueryBind` test helper
8789
* Fixed topic retry policy callback call: not call it with nil error
8890
* Fixed bug with no checking operation error on `discovery.Client` calls

sugar/stack.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package sugar
2+
3+
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
4+
5+
func StackRecord(depth int) string {
6+
return stack.Record(depth + 1)
7+
}

sugar/stack_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package sugar
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/require"
7+
)
8+
9+
func TestStackRecord(t *testing.T) {
10+
require.Equal(t, `github.com/ydb-platform/ydb-go-sdk/v3/sugar.TestStackRecord(stack_test.go:10)`, StackRecord(0))
11+
}

0 commit comments

Comments
 (0)