forked from databricks/databricks-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalias.go
34 lines (29 loc) · 781 Bytes
/
alias.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package databricks
import (
"github.com/databricks/databricks-sdk-go/config"
"github.com/databricks/databricks-sdk-go/useragent"
"github.com/databricks/databricks-sdk-go/version"
)
type Config config.Config
// Must panics if error is not nil. It's intended to be used with
// [databricks.NewWorkspaceClient] and [databricks.NewAccountClient].
func Must[T any](c T, err error) T {
if err != nil {
panic(err)
}
return c
}
// Version of this SDK
func Version() string {
return version.Version
}
// WithProduct is expected to be set by developers to differentiate their app from others.
//
// Example setting is:
//
// func init() {
// databricks.WithProduct("your-product", "0.0.1")
// }
func WithProduct(name, version string) {
useragent.WithProduct(name, version)
}