Skip to content

Fixed error messages in TestDefault #28

Open

Description

@ablankz

A partial code of cors_test.go is shown below.

if s.allowedHeaders == nil {
    t.Error("c.allowedHeaders should be nil when Default")
}
if s.allowedMethods == nil {
    t.Error("c.allowedMethods should be nil when Default")
}

We believe the following message is appropriate for this.

if s.allowedHeaders == nil {
    t.Error("c.allowedHeaders must not be nil when Default")
}
if s.allowedMethods == nil {
    t.Error("c.allowedMethods must not nil when Default")
}

Activity

  1. Krishnanand-G commented on Jun 29, 2026

    @Krishnanand-G

    Opened PR #42 to close this. TestDefault already had the corrected messages on master; the PR fixes the remaining misleading error messages in TestIsMethodAllowedReturnsFalseWithNoMethods and TestIsMethodAllowedReturnsTrueWithOptions.

  2. added 3 commits that reference this issue on Jun 29, 2026
    b5442f6
    37c2d28
    39eaac6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions