Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Salmela <[email protected]>
  • Loading branch information
jacobsalmela committed May 28, 2024
1 parent 7efcbf8 commit 9681fde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions internal/provider/ngsm/expert_bom.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ func (row *Row) RackDimensions() (width int, depth int, unit string, err error)
return width, depth, "mm", nil
}

// RackDimensions returns the width and depth of a rack in millimeters parsed
// via regex from the product description 'NNNmmxNNNmm'
// RackHeightU returns the height of a rack in U parsed via regex from the product description
func (row *Row) RackHeightU() (u int, err error) {
re := regexp.MustCompile(`\d+U`)
height := re.FindString(row.ProductDescription)
Expand Down Expand Up @@ -162,7 +161,7 @@ func (row *Row) IsDevice(deviceTypeIds map[string]int32) bool {
// NewRowFromRow returns a new row from the existing row
// this is often used to create a duplicate row if the quantity is more than 1
// a few fields need to be set by the consumer of this function, like the netbox
// namne, source, etc.
// name, source, etc.
func (row *Row) NewRowFromRow() (newRow Row) {
newRow = Row{}
newRow.SetRow(row.row)
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/ngsm/expert_bom_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (q *queue) addRow(row *Row) (err error) {
return nil
}

// Sanitize attepts to sanitize the row's content so valid data is returned
// Sanitize attempts to sanitize the row's content so valid data is returned
// this will do things like normalize part numbers, clean up blankspace, etc.
func (row *Row) Sanitize() (parsed *Row, err error) {
// sanitize the row's content
Expand Down

0 comments on commit 9681fde

Please sign in to comment.