• Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.0.1
    • Component/s: None

      I've noticed that there is a lot of real bugs in the code.

      I've detected them with https://github.com/golangci/golangci-lint

      and this config:

       

      run:
        deadline: "10m"
      linters:
        disable-all: true
        enable:
          - "deadcode"
          - "errcheck"
          - "gofmt"
          - "goimports"
          - "golint"
          - "govet"
          - "ineffassign"
          - "megacheck"
          - "misspell"
          - "nakedret"
          - "structcheck"
          - "unconvert"
          - "unparam"
          - "varcheck"
      issues:
        exclude-use-default: false
        max-per-linter: 0
        max-same-issues: 0
      
      

       

      Example of bugs:

      bson/primitive/primitive.go:58:38: SA4000: identical expressions on the left and right side of the '==' operator (staticcheck)bson/primitive/primitive.go:58:38: SA4000: identical expressions on the left and right side of the '==' operator (staticcheck) return rp.Pattern == rp2.Pattern && rp.Options == rp.Options
      

      Maybe it should be "rp2" ?

      bson/bsonrw/extjson_parser.go:136:6: ineffectual assignment to `err` (ineffassign)bson/bsonrw/extjson_parser.go:136:6: ineffectual assignment to `err` (ineffassign) err = ejp.err
      

      The error is assigned, but never checked.

       

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            pierrre Pierre Durand
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: