Go

Go

Made by DeepSource

Reassignment of an error from another package GO-W4007

Bug risk
Major

Reassigning an error from a different package may lead to bugs as the modified error is reflected globally (i.e., across the program).

Bad practice

package main

import (
    "io"
)

func foo() {
    io.EOF = nil
}

Recommended

package main

import (
    "io"
)

func foo() {
    // Do not reassign the error
}