简体   繁体   English

如何使用 Azure devops GO 实现将 uuid 值转换为字符串

[英]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.我正在使用 azure devops package for go 来查询服务端点列表。

I call the function: func (client ClientImpl) GetServiceEndpoints(ctx context.Context, args GetServiceEndpointsArgs) ( []ServiceEndpoint, error)我调用 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 serviceendpoint 的返回类型定义如下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.我从模块得到的返回值是 uuid 格式。 How can I get this as a useable format like resourceId=90d8caad-7150-4a36-9075-597479fe72f1我怎样才能把它作为一种可用的格式,比如 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.如您所见,数组中的每个值都包含 azure devops 中的一段实际 ID。

The UUID type has a String method : UUID 类型有一个String 方法

func (uuid UUID) String() string

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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