Skip to content

Commit

Permalink
refactor: go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jufemaiz committed Nov 20, 2024
1 parent dcfbde4 commit 59cf328
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion nem12/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func (f Field) GoString() string {
}

// Validate returns any errors for the value of the field.
//
//nolint:funlen
func (f Field) Validate() error { //nolint:cyclop,gocyclo
switch f.Type {
Expand Down Expand Up @@ -370,9 +371,10 @@ func validateFieldNMISuffix(v string) error {
// The value must match the MDMContributorySuffix value provided in an MDFF File.
//
// Ref:
//nolint:lll
// <https://www.aemo.com.au/-/media/files/stakeholder_consultation/consultations/nem-consultations/2019/5ms-metering-package-3/final/standing-data-for-msats-final-clean.pdf>
// Table 15, pg 32.
//
//nolint:lll
func validateFieldMDMDataStreamIdentifier(v string) error {
if v == "" {
// No longer return an error. // return fmt.Errorf("field MDM data stream identifier: %w", ErrFieldNil)
Expand Down
8 changes: 6 additions & 2 deletions nem12/interval.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ type IntervalSet struct {
Metadata *IntervalMetadata `json:"metadata,omitempty"`
}

//nolint:misspell
// Normalize returns the interval set in SI units.
//
//nolint:misspell
func (is *IntervalSet) Normalize() (*IntervalSet, error) { //nolint:misspell
if is == nil {
return nil, nil
Expand Down Expand Up @@ -75,8 +76,9 @@ type Interval struct {
Metadata *IntervalMetadata `json:"metadata,omitempty"`
}

//nolint:misspell
// Normalize returns the interval in SI units.
//
//nolint:misspell
func (i *Interval) Normalize(uom *UnitOfMeasure) (*Interval, error) { //nolint:misspell
if i == nil {
return nil, ErrIntervalNil
Expand Down Expand Up @@ -117,6 +119,7 @@ type IntervalLength time.Duration

// An IntervalValue represents a single meter interval value as presented by an
// NEM12 file.
//
//nolint:lll
type IntervalValue struct {
Value float64 `json:"value"` // Value of the interval in the SI unit of measure.
Expand Down Expand Up @@ -147,6 +150,7 @@ type intervalEvent struct {
}

// newIntervalEvent returns a new interval event for a record.
//
//nolint:funlen
func newIntervalEvent(rec Record) (*intervalEvent, error) {
var (
Expand Down
1 change: 1 addition & 0 deletions nem12/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (p *parser) ReadDay() (*IntervalSet, error) {

// readDay implements the actual read day capability, making it commonly
// available to the interface functions.
//
//nolint:gocognit,dupl,funlen
func (p *parser) readDay() (set *IntervalSet, err error) { //nolint:cyclop,gocyclo
defer func() {
Expand Down
3 changes: 2 additions & 1 deletion nem12/reason.go
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,9 @@ func (r Reason) GoString() string {
return fmt.Sprintf("%%!Reason(%d)", r)
}

//nolint:gocritic
// Deprecated indicates if this method is a deprecated method.
//
//nolint:gocritic
func (r Reason) Deprecated() bool {
dep, ok := reasonsDeprecated[r]
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion nmi/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// From: https://aemo.com.au/-/media/files/electricity/nem/retail_and_metering/metering-procedures/2016/0610-0008-pdf.pdf
//
// NMI Structure
// # NMI Structure
//
// The NMI is a ten (10) character identifier assigned by Local Network Service
// Providers (LNSPs) in accordance with this procedure. The publication of this
Expand Down

0 comments on commit 59cf328

Please sign in to comment.