Skip to content

Commit c392fdb

Browse files
committed
fix usage of environ credentials
1 parent ab93e19 commit c392fdb

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

examples/basic/gorm/main.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package main
22

33
import (
4-
"context"
54
"log"
65
"os"
7-
"time"
86

97
ydb "github.com/ydb-platform/gorm-driver"
108
environ "github.com/ydb-platform/ydb-go-sdk-auth-environ"
@@ -23,9 +21,6 @@ SQLITE_CONNECTION_STRING
2321
YDB_CONNECTION_STRING`
2422

2523
func main() {
26-
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
27-
defer cancel()
28-
2924
cfg := &gorm.Config{
3025
Logger: logger.Default.LogMode(logger.Error),
3126
}
@@ -43,7 +38,7 @@ func main() {
4338
dsn,
4439
ydb.WithTablePathPrefix("gorm"),
4540
ydb.With(
46-
environ.WithEnvironCredentials(ctx),
41+
environ.WithEnvironCredentials(),
4742
),
4843
),
4944
cfg,

0 commit comments

Comments
 (0)