• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eclipse-aascw / aas-core-codegen / 34782402679
85%

Build:
DEFAULT BRANCH: main
Ran 13 Sep 2026 09:04PM UTC
Jobs 3
Files 269
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Sep 2026 08:58PM UTC coverage: 85.286% (+0.01%) from 85.272%
34782402679

push

github

web-flow
Compose the Go XML serialization (#689)

Write-side dual of #688, as #687 was of #686 in C#.

Measured on the AAS meta-model fixture, the serialization region of
``xmlization.go`` goes 11,080 -> 4,727 lines (-57%), and the file as
a whole 16,692 -> 10,330. ``writeExtensionAsSequence`` and its six
properties go 180 -> 69 lines.

Everything is written through one shape,
``func(encoder, value T) error``. A stringification, a class's own
``write<X>AsSequence`` and the generated item, list and tuple writers
all have it, so ``writeElement`` -- which frames an XML element around
a value written that way -- is the only writer a property needs,
whatever kind of value it holds. What is left per property is that one
call and a decision on presence:

    err = finishProperty(
        "SemanticID()",
        writeOptionalInstance(
            encoder,
            "semanticId",
            that.SemanticID(),
            writeReferenceAsSequence,
        ),
    )
    if err != nil {
        return
    }

``finishProperty`` takes the *result* of the write rather than the write
itself -- the same trick as the read side's ``readOptional``, since Go
evaluates the argument first -- so one function concludes every
property, prepending the getter to the path of the error.

Mind that the getter is spelled out as it is in Go, ``SemanticID()`` and
not ``semanticId``, since a serialization error renders its path through
``aasreporting.ToGolangPath``, while the de-serialization prepends
the XML name, its errors being XPaths. Go has no ``nameof``.

The ``writeOptional*`` family has one member per way Go spells an
optional, each named after that spelling, as the check for the presence
is the only thing which differs between them: a pointer to the value
(``writeOptionalPointer``: a scalar, an enumeration, a tuple), a value
which is nil on its own (``writeOptionalInstance``: an instance, or
a named union, which is a pointer to a struct) and a slice
(``writeOptionalSlice``: a list, ... (continued)

232 of 238 new or added lines in 1 file covered. (97.48%)

33977 of 39839 relevant lines covered (85.29%)

2.56 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
95.96
0.14% aas_core_codegen/golang/lib/_generate_xmlization.py
Jobs
ID Job ID Ran Files Coverage
1 3.10 - 34782402679.1 13 Sep 2026 09:06PM UTC 269
85.29
GitHub Action Run
2 3.11 - 34782402679.2 13 Sep 2026 09:06PM UTC 269
85.29
GitHub Action Run
3 3.12 - 34782402679.3 13 Sep 2026 09:06PM UTC 269
85.29
GitHub Action Run
Source Files on build 34782402679
  • Tree
  • List 269
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 5e4bd0b3 on github
  • Prev Build on main (#34776303801)
  • Next Build on main (#34890273264)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc