Skip to content

Commit

Permalink
fix go lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdatasourav committed Aug 25, 2023
1 parent b095c2c commit 8c6cdb0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openapi/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func findBlockLinesFromJSON(file *os.File, blockName string, pathName ...string)
inBlock, inPath, inResponseStatus, inRequestBody, inServer, inComponent := false, false, false, false, false, false

// Move the file pointer to the start of the file.
file.Seek(0, 0)
_, _ = file.Seek(0, 0)
scanner := bufio.NewScanner(file)

for scanner.Scan() {
Expand Down Expand Up @@ -193,15 +193,16 @@ func findBlockLinesFromJSON(file *os.File, blockName string, pathName ...string)
return startLine, endLine
}

// findBlockLinesFromJSON locates the start and end lines of a specific block or nested element within a block.
// findBlockLinesFromYML locates the start and end lines of a specific block or nested element within a block.
// The file should contain structured data (e.g., YML/YAML) and this function expects to search for blocks with specific names.
func findBlockLinesFromYML(file *os.File, blockName string, pathName ...string) (int, int) {
var currentLine, startLine, endLine, currentIndentLevel int
var blockIndentLevel, pathIndentLevel, serverIndentLevel, requestBodyIndentLevel, componentIndentLevel, responseIndentLevel = -1, -1, -1, -1, -1, -1

inBlock, inPath, inServer, inRequestBody, inComponent, inResponseStatus := false, false, false, false, false, false

file.Seek(0, 0)
// Move the file pointer to the start of the file.
_, _ = file.Seek(0, 0)
scanner := bufio.NewScanner(file)

for scanner.Scan() {
Expand Down

0 comments on commit 8c6cdb0

Please sign in to comment.