Skip to content

Commit f78f31b

Browse files
committed
Document why RemapState leaves ForceSendFields nil
Per denik's PR comment: explain that ForceSendFields is an SDK marshaling concern (which zero-valued fields to wire-serialize) that has no meaning on the read path, so copying it from the response struct would not be useful. Co-authored-by: Isaac
1 parent 6167150 commit f78f31b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bundle/direct/dresources/vector_search_index.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ func (*ResourceVectorSearchIndex) RemapState(remote *VectorSearchIndexRemote) *V
9696
EmbeddingWritebackTable: remote.DeltaSyncIndexSpec.EmbeddingWritebackTable,
9797
PipelineType: remote.DeltaSyncIndexSpec.PipelineType,
9898
SourceTable: remote.DeltaSyncIndexSpec.SourceTable,
99-
ForceSendFields: nil,
99+
// ForceSendFields is an SDK marshaling concern (which zero-valued
100+
// fields to wire-serialize) that has no meaning on the read path.
101+
// Local config doesn't carry one either, so leave it nil rather
102+
// than copy whatever the response struct happened to use.
103+
ForceSendFields: nil,
100104
}
101105
}
102106
return state

0 commit comments

Comments
 (0)