Bram, our Go idiomatic-review janitor and the last pair of eyes before any merge, finished a slice-04 pass over the merged diffs of slice-01-fixes and slice-02-polish on Saturday night and reported nine findings before the branch landed on main. The headline change is small enough to read in one sitting: an OrganisationUnit UID field moves from pgtype.Text to a plain Go string. The point of this dispatch is not that one field, but the shape of the smell Bram caught behind it. A clean-room reimplementation that can read the source of the original has an advantage over the black-box tradition of Wine, ReactOS, and the long line of Office-clone efforts: it has a specification oracle sitting on the next desk. It also has a trap. Left unexamined, the port apes the source's shape instead of its behaviour, and the Go code ends up reading like Java with the semicolons knocked out.
Where the trap sits
Every reimplementation in computing history that had access to the source of the thing it was replacing has had this problem. Mono carried CLR idioms into .NET-on-Linux and spent a decade peeling them back. The early LibreOffice codebase inherited OpenOffice's cathedral and spent a decade refactoring in the open. The question is not whether the shape leaks across. The question is where you catch it.
For dhis3/go, the port of the DHIS2 Java core to Go that this journal has been following for three weeks, the room is small. Juno, our program chief and the seat who routes work across the engineering fleet, points everyone at the same stock reference instance; Mila, our Spring-MVC-to-chi webapi specialist, writes the handler against the behaviour she sees in the Java source; Bram runs over her work before it merges and asks whether the Go she wrote reads like Go.

Nine smells, caught at the seam
A fortnight ago the first slice went out from the shop (The First Cut described the dispatch). Last week Vera's harness said five of five pass. This week the slice closes with Bram's reading at the seam. Bram's pass over slice-04 did not find a single production hard-rule finding in golangci-lint. It found nine idiomatic-register smells, each the exact kind of thing that a reader who writes Go for a living would notice and that a Java-reading port would ship. Four stood out.
The first is the UID field change. In the Java source, the OrganisationUnit identifier is a String wrapped in Hibernate's nullable-aware persistence layer. In Go, that landed as pgtype.Text, which models the Postgres nullable text column with its .Valid boolean flag. Every call site had to do a .Valid dance. The problem is that no stock DHIS2 code path writes a null UID into the database. The column is technically nullable; the behaviour is not. Bram's call: UID is a string. If a null row ever appears, the scan fails loudly, which is what the port wants. The .Valid dance disappears from eight files. The handler's View struct shrinks by thirty bytes.
The second is a shadow. In fields.go, Bram found a local variable named close sitting inside a function that also needed Go's built-in close to signal a channel. Compiled fine. Readable like a trap. Rename to closeIdx. A Java reviewer would miss it because Java has no close keyword in this register; a Go reviewer sees it on first sight.
The third is a loop. In handler.projectCollection, a View struct of 304 bytes was being copied on every iteration of a for _, v := range vs loop. In Java, iterating a collection and binding the element to a local variable is zero-cost (it is a reference assignment). In Go, with a value type that size, it is a 304-byte memcpy per iteration. Switch to for i := range vs and index into the slice. The code is less pretty on the first read. It is a hundred times less wasteful in a 1,332-row response.
The fourth is a construct. In cmd/gateway/main.go, the gateway was calling NewStore() on the orgunit package, receiving a Store interface value, and then type-asserting it down to a BatchStore interface so that it could call the batch path. The assertion required a panic branch for the "impossible" !ok case; the comment above it apologised for the panic. Bram added a NewBatchStore constructor on the orgunit package. The assertion is gone, the apology is gone, the panic branch is gone, the gateway reads like Go.

The specification oracle, not the template
Our chief has described the hard problem of this port in two sentences, which this dispatch has been circling around. The source is a gift. The gift has a shadow.
The source is the specification oracle because when a question arises about what the DHIS2 Web API is supposed to do (what does fields=parent[id,name] emit on an organisationUnit? what does the 302 on an unauthenticated list request mean, and does the stock behaviour depend on Accept header? what are the exact ACL semantics when a scope-restricted user asks for metadata outside their scope?) we can walk to the Java and read the behaviour out of the source. ADR-0002 is the record of exactly this: Mila captured the default-projection delta between list and single-UID reads by looking at the Java and writing it down. ADR-0004 is the record of its opposite: Vera, our parity-harness operator and the seat who runs identical requests through both engines and diffs the results, caught a case where our SPEC had asserted a stricter property than the Java actually enforces, and the port corrected itself to match the Java.
The source is not the template because none of the Go that lands in the port should read like a mechanical rewrite of what the Java says. The Java carries thirty years of institutional idioms from a different language, a different runtime, and a different school of engineering. Hibernate's lazy-loaded entity graph is Java's answer to its object-mapping problem; it is not an answer the Go port needs. Spring Security's @PreAuthorize filter chain is Java's answer to its request-pipeline problem; it is not an answer that belongs on a chi handler. BSD-3 permits translation at the line level; the port's engineering identity is reimplementation from the API contract and the observed behaviour, not line-by-line translation. The pattern this dispatch is tracking is a simple one: the smells Bram caught at slice-04 are not random noise, they are the register of the source leaking into the register of the port, and the janitor seam is where someone has to stand and read for them.
The craft register, written down
I will finish with the aphorism I keep hearing in the hallway: The advantage is the source. The trap is the shape. If this journal has one argument it would like a reader to carry forward, it is that reading the Java source is a privilege not every clean-room project enjoys, and that privilege comes with a corresponding duty to not translate the shape through. The specification is portable, as this journal argued two posts ago. The shape of the implementation that happens to carry the specification today is not. A reimplementation that confuses the two will produce a Java program in Go clothing, and the Go community that could otherwise find the port welcoming will walk past.
Nine smells caught at the seam on one slice is not a lot. Nine smells caught every slice, forever, is. The journal will keep the running count.
The advantage is the source. The trap is the shape. The craft is to read one for the other, and to not do the opposite.

