v1.0.4
Documentation, lint hardening, and code-quality improvements. No API changes, no behavior changes.
Dependencies
- Bumped
github.com/otfabric/go-mmsfrom v1.0.3 → v1.0.4 (documentation and lint hardening; no API or behavior changes). - Bumped
github.com/otfabric/go-cotp(indirect) from v1.0.1 → v1.0.2.
Documentation — error taxonomy covering all 20 sentinel values, 7 typed error structs
(ReferenceError, DecodeError, ModelError, ReportError, SCLParseError,
DataAccessError, ControlError), underlying MMS error passthrough, and errors.Is /
errors.As usage patterns.
- Added link to
ERRORS.mdinREADME.mddocumentation table and repository file-tree section.
Linting and code quality
golangci-lintexclusion-free (except two documented gocritic disables):- Removed blanket
errchecksuppression for test files; all issues fixed in code. - Removed dead
staticcheck SA2002test-file exclusion (SA2002 does not occur in this repo). ifElseChaindisabled: three-branchif/else if/elsepatterns are preferred overswitch
for exclusive error-then-nil-then-value decisions.exitAfterDeferdisabled:Example_*documentation functions intentionally show
defer client.Closefollowed bylog.Fatalto model correct cleanup for users.
- Removed blanket
- Fixed unchecked error returns across 10 test files:
c.Abort,sub.Close,defer sub.Close→_ = ...ordefer func() { _ = ... }()srv.MMS().SetVariableRead(...)→ wrapped inif err := ...; err != nil { t.Fatalf(...) }srv.RegisterControl(...)inexample_test.go→_ = srv.RegisterControl(...)
- Converted
if/else if/elsechains inbulk.goanddataset.gotoswitchstatements. - Fixed
exitAfterDeferin all example programs (basic-client,control,files,reports,
ied-client,ied-server) andscl/cmd/sclgen: moveddefer cancel()/defer stop()to
after the last potential fatal exit; explicit cleanup called before eachlog.Fatal. - Removed unused test helper return values:
setupRCBLoopbackdropped*mms.Serverreturn (never used by any caller).setupWritableLoopbackdropped*writableVarsreturn (never used by any caller).executeCmdinscl/cmd/sclparsedroppedstringreturn (never used by any caller).
- Added
unparamandgocriticlinters to.golangci.yml. - Added
vulntarget (govulncheck) toMakefileand wired it intomake check.
No API changes. No breaking changes.
Import path remains github.com/otfabric/go-iec61850.