![](/img/trans.png)
[英]How to convert a Postgres UUID back to human-readable string in Go?
[英]How to convert uuid value to string using Azure devops GO implementation
我正在使用 azure devops package for go 來查詢服務端點列表。
我調用 function: func (client ClientImpl) GetServiceEndpoints(ctx context.Context, args GetServiceEndpointsArgs) ( []ServiceEndpoint, error)
serviceendpoint 的返回類型定義如下https://pkg.go.dev/github.com/microsoft/azure-devops-go-api/azuredevops@v1.0.0-b5/serviceendpoint#ServiceEndpoint
我從模塊得到的返回值是 uuid 格式。 我怎樣才能把它作為一種可用的格式,比如 resourceId=90d8caad-7150-4a36-9075-597479fe72f1
如您所見,數組中的每個值都包含 azure devops 中的一段實際 ID。
UUID 類型有一個String 方法:
func (uuid UUID) String() string
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.