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

enbility / eebus-go / 27195019205
95%

Build:
DEFAULT BRANCH: dev
Ran 09 Jun 2026 08:54AM UTC
Jobs 1
Files 90
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

09 Jun 2026 08:52AM UTC coverage: 95.244% (-0.04%) from 95.286%
27195019205

push

github

web-flow
Add missing nil/length guards before pointer dereferences (#219)

Follow-up to #218.

While fixing #217, I audited the codebase for the same class of bug — a
slice element subfield dereferenced without a nil guard, or `[0]`
indexing without a `len > 0` check. EEBus model fields are almost all
`*T` and optional per spec, so a conformant remote that omits one of
them would panic the client.

## Findings

| File | Site | Pattern |
| --- | --- | --- |
| `usecases/cem/evcem/public.go` | `PowerPerPhase` |
`*elParam[0].AcMeasuredPhases` dereferenced; only `len(elParam) == 0`
was guarded. `AcMeasuredPhases` is optional. |
| `usecases/cem/cevc/public_scen3.go` |
`WriteIncentiveTableDescriptions` | `descriptions[0].TariffDescription`
accessed after only an error check; no `len(descriptions) > 0` guard. |
| `usecases/eg/lpc/public.go` | `ConsumptionLimit` |
`*limitDescriptions[0].LimitId` dereferenced; `len(limitDescriptions) !=
1` was guarded but `LimitId == nil` was not. |
| `usecases/eg/lpp/public.go` | `ProductionLimit` | Same pattern as
`lpc/public.go`. |

Each site adds the missing guard and bails out early (`continue` / early
return / `api.ErrDataNotAvailable`).

## Test

No fixture changes — these are defensive guards against malformed remote
data and the existing per-usecase test suites continue to pass:

```
go test ./usecases/cem/evcem/... ./usecases/cem/cevc/... ./usecases/eg/lpc/... ./usecases/eg/lpp/...
ok  github.com/enbility/eebus-go/usecases/cem/evcem
ok  github.com/enbility/eebus-go/usecases/cem/cevc
ok  github.com/enbility/eebus-go/usecases/eg/lpc
ok  github.com/enbility/eebus-go/usecases/eg/lpp
```

Building and vetting the full module is clean.

4 of 6 new or added lines in 4 files covered. (66.67%)

13 existing lines in 1 file now uncovered.

7250 of 7612 relevant lines covered (95.24%)

12.41 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
94.34
-0.88% usecases/cem/cevc/public_scen3.go

Coverage Regressions

Lines Coverage ∆ File
13
93.4
-0.59% usecases/internal/loadcontrol.go
Jobs
ID Job ID Ran Files Coverage
1 27195019205.1 09 Jun 2026 08:54AM UTC 90
95.24
GitHub Action Run
Source Files on build 27195019205
  • Tree
  • List 90
  • Changed 5
  • Source Changed 5
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27195019205
  • 247bdabc on github
  • Prev Build on dev (#26174189335)
  • Next Build on dev (#27195008224)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc