package alils import ( "fmt" "github.com/aliyun/aliyun-log-go-sdk/producer" ) type Callback struct { } func (callback *Callback) Success(result *producer.Result) { attemptList := result.GetReservedAttempts() for _, attempt := range attemptList { fmt.Printf("%+v \n", attempt) } } func (callback *Callback) Fail(result *producer.Result) { fmt.Println(result.IsSuccessful()) fmt.Println(result.GetErrorCode()) fmt.Println(result.GetErrorMessage()) fmt.Println(result.GetReservedAttempts()) fmt.Println(result.GetRequestId()) fmt.Println(result.GetTimeStampMs()) }