Skip to content

function assigned to a package variable could not be detected with Call. #52

@sonatard

Description

@sonatard
package http_request

import (
	"context"
	"net/http"
)

var newRequestPkg = http.NewRequest

func _() {
	const url = "https://example.com"
	cli := &http.Client{}
	ctx := context.Background()
	req52, _ := newRequestPkg(http.MethodPost, url, nil) // TODO: false negative `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
	cli.Do(req52)

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