Skip to content

spanner: time.Time Field is not initialized in SelectAll #9381

@YTreds

Description

@YTreds

Client

Spanner

Go Environment

Go1.21

Code

e.g.

	type Singer struct {
		ID         int64     `spanner:"ID"`
		Name       string    `spanner:"Name"`
		LastUpdate time.Time `spanner:"LastUpdate"`
	}
	var singer []Singer
	if err := spanner.SelectAll(iter, &singer); err != nil {
		fmt.Println(err) // spanner: code = "InvalidArgument", desc = "Go struct {ID:0 Name: LastUpdate:0001-01-01 00:00:00 +0000 UTC}(type reflect.Value) has no or duplicate fields for Cloud Spanner STRUCT field LastUpdate"
		return
	}

Additional context

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the Spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions