简体   繁体   中英

How to convert uuid value to string using Azure devops GO implementation

I am using the azure devops package for go, to query a list of service endpoints.

I call the function: func (client ClientImpl) GetServiceEndpoints(ctx context.Context, args GetServiceEndpointsArgs) ( []ServiceEndpoint, error)

The return type of serviceendpoint is defined as below https://pkg.go.dev/github.com/microsoft/azure-devops-go-api/azuredevops@v1.0.0-b5/serviceendpoint#ServiceEndpoint

The return value I get from the module is in uuid format. How can I get this as a useable format like resourceId=90d8caad-7150-4a36-9075-597479fe72f1 在此处输入图像描述

As you can see each value in the array contains a piece of the actual ID in azure devops.

The UUID type has a String method :

func (uuid UUID) String() string

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM