Giter VIP home page Giter VIP logo

Comments (5)

mvdan avatar mvdan commented on May 10, 2024 1

Thanks - I can reproduce now. Should be a simple enough fix.

from unparam.

mvdan avatar mvdan commented on May 10, 2024

Thanks. Just to confirm - are you using the latest master version, e6a6d1c? I fixed a few false positives this morning.

from unparam.

cloudlena avatar cloudlena commented on May 10, 2024

Yes, I just downloaded it with go get -u mvdan.cc/unparam.

from unparam.

mvdan avatar mvdan commented on May 10, 2024

I can't reproduce it:

$ cat go.mod
module repro

go 1.12

require github.com/aws/aws-sdk-go-v2 v0.7.0
$ cat f.go
package main

import (
        "fmt"

        "github.com/aws/aws-sdk-go-v2/aws"
)

func main() {
        resolver := aws.EndpointResolverFunc(func(string, string) (aws.Endpoint, error) {
                return aws.Endpoint{}, nil
        })
        fmt.Println(resolver)
}
$ unparam .
$

Could you provide the steps to reproduce the problem within a Docker container? That way I'll very likely be able to reproduce it. For example, the following still doesn't show me any unparam warning:

#!/bin/bash

docker run -i golang:1.11.4-stretch <<-SCRIPT

        echo "installing unparam"
        export GO111MODULE=off # to install unparam properly
        go get -u mvdan.cc/unparam

        echo "setting up temp module"
        export GO111MODULE=on
        mkdir temp
        cd temp
        go mod init temp

        cat >f.go <<FILE
        package main

        import (
                "fmt"

                "github.com/aws/aws-sdk-go-v2/aws"
        )

        func main() {
                resolver := aws.EndpointResolverFunc(func(string, string) (aws.Endpoint, error) {
                        return aws.Endpoint{}, nil
                })
                fmt.Println(resolver)
        }
        FILE
        echo "downloading deps"
        go mod tidy

        echo "running unparam"
        unparam .

SCRIPT

from unparam.

cloudlena avatar cloudlena commented on May 10, 2024

Sorry, I just noticed that my example was incomplete and, indeed, didn't reproduce the issue. I fixed it above and simplified the example some more and it should work now to reproduce. I had to add URL: "url" for it to reproduce the issue. It works fine without that part.

from unparam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.