22 lines
493 B
Go
22 lines
493 B
Go
package sdk_LinkedMall
|
||
|
||
import (
|
||
"fmt"
|
||
"log"
|
||
"os"
|
||
)
|
||
|
||
// ExampleNewClient 演示如何创建客户端
|
||
func ExampleNewClient() {
|
||
// 从环境变量获取AK,禁止硬编码
|
||
accessKeyId := os.Getenv("LINKEDMALL_AK_ID")
|
||
accessKeySecret := os.Getenv("LINKEDMALL_AK_SECRET")
|
||
|
||
cli, err := NewClient(accessKeyId, accessKeySecret)
|
||
if err != nil {
|
||
log.Fatalf("failed to create client: %v", err)
|
||
}
|
||
_ = cli
|
||
fmt.Println("client created successfully")
|
||
// Output: client created successfully
|
||
} |