congqixia b389068584
fix: [GoSDK] align timestamptz field type and data format with server (#47304)
Related to #47303

The Go SDK had two issues with Timestamptz field type:

1. FieldTypeTimestamptz was incorrectly defined as 15, but server
expects 26
2. Timestamptz data was serialized as int64 via TimestamptzData, but
server expects ISO 8601 strings (RFC3339Nano format) via StringData

Changes:
- Update FieldTypeTimestamptz value from 15 to 26
- Modify ColumnTimestamptz to store data as RFC3339Nano strings
internally
- Change NewColumnTimestamptz to accept []time.Time and convert to ISO
strings
- Add ColumnTimestampTzIsoString for direct ISO string input
- Update FieldDataColumn to parse Timestamptz from StringData
- Update values2Scalars to handle Timestamptz as string type
- Add NewNullableColumnTimestamptz for nullable time.Time input
- Update NewNullableColumnTimestamptzIsoString for nullable ISO string
input
- Add corresponding unit tests

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2026-01-26 19:51:32 +08:00
..

Go MilvusClient

license Go Reference

Go MilvusClient for Milvus. To contribute code to this project, please read our contribution guidelines first.

Getting started

Prerequisites

Go 1.24.11 or higher

Install Milvus Go SDK

  1. Use go get to install the latest version of the Milvus Go SDK and dependencies:

    go get -u github.com/milvus-io/milvus/client/v2
    
  2. Include the Go MilvusClient in your application:

     import "github.com/milvus-io/milvus/client/v2/milvusclient"
    
     //...other snippet ...
     ctx, cancel := context.WithCancel(context.Background())
     defer cancel()
    
     milvusAddr := "YOUR_MILVUS_ENDPOINT"
    
     cli, err := milvusclient.New(ctx, &milvusclient.ClientConfig{
     	Address: milvusAddr,
     })
     if err != nil {
     	// handle error
     }
    
     // Do your work with milvus client
    

API Documentation

Refer to https://milvus.io/api-reference/go/v2.5.x/About.md for the Go SDK API documentation.

Code format

The Go source code is formatted using gci & gofumpt. Please run make lint-fix before sumbit a PR.