@@ -81,7 +81,7 @@ keygen.Logger = &CustomLogger{Level: keygen.LogLevelDebug}
81
81
82
82
The following top-level functions are available. We recommend starting here.
83
83
84
- ### keygen.Validate(fingerprints ...string)
84
+ ### keygen.Validate(ctx, fingerprints ...string)
85
85
86
86
To validate a license, configure ` keygen.Account ` and ` keygen.Product ` with your Keygen account
87
87
details. Then prompt the end-user for their license key or token and set ` keygen.LicenseKey `
@@ -96,8 +96,7 @@ It will return a `License` object as well as any validation errors that occur. T
96
96
object can be used to perform additional actions, such as ` license.Activate(fingerprint) ` .
97
97
98
98
``` go
99
- ctx := context.Background ()
100
- license , err := keygen.Validate (ctx, fingerprint)
99
+ license , err := keygen.Validate (context.Background (), fingerprint)
101
100
switch {
102
101
case err == keygen.ErrLicenseNotActivated :
103
102
panic (" license is not activated!" )
@@ -110,7 +109,7 @@ case err != nil:
110
109
fmt.Println (" License is valid!" )
111
110
```
112
111
113
- ### keygen.Upgrade(options keygen.UpgradeOptions)
112
+ ### keygen.Upgrade(ctx, options keygen.UpgradeOptions)
114
113
115
114
Check for an upgrade. When an upgrade is available, a ` Release ` will be returned which will
116
115
allow the update to be installed, replacing the currently running binary. When an upgrade
@@ -482,7 +481,7 @@ package main
482
481
483
482
import (
484
483
" context"
485
-
484
+
486
485
" github.com/keygen-sh/keygen-go/v3"
487
486
)
488
487
0 commit comments