singhpratech opened a new pull request, #1320: URL: https://github.com/apache/arrow-go/pull/1320
### Rationale for this change The comment above `NewDatumWithoutOwning` is separated from the declaration by a blank line, so `go doc` and pkg.go.dev show the function with no documentation at all. The text itself has a sentence with no main clause and ends in stray characters (`convenience function.+-`). The function's one hazard, a `Release` call that releases the caller's reference (#1298), is the thing a reader most needs to see and currently cannot. ### What changes are included in this PR? The comment now sits on the declaration and states the contract: the returned `Datum` owns nothing, the caller keeps the value alive for as long as the `Datum` is in use and must not call `Release` on it, and since the `Datum` is an ordinary `ArrayDatum`/`ChunkedDatum`/`RecordDatum`/`TableDatum`/ `ScalarDatum`, a `Release` call compiles and releases the caller's reference, which with a C-backed allocator or cdata-imported buffers frees memory under a live value. It ends by pointing at `NewDatum` for the owning case. ### Are these changes tested? Documentation only. `go doc ./arrow/compute NewDatumWithoutOwning` renders the two paragraphs; gofmt and `go vet ./arrow/compute/` are clean. ### Are there any user-facing changes? Documentation only. Whether a non-owning `Datum` should refuse `Release` (a no-op, a distinct type, or a panic) is a separate decision and stays with #1298; this change does not close it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
