sdk_LinkedMall-20260828093422/sdk_LinkedMall/example_test.go

22 lines
493 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}