Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/eg: does not support variadic functions #17529

Open
mrwonko opened this issue Oct 20, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@mrwonko
Copy link

commented Oct 20, 2016

What version of Go are you using (go version)?

Go 1.7.1
eg 69f6f5b782e1f090edb33f68be67d96673a8059e

What operating system and processor architecture are you using (go env)?

MacOSX 10.12 Sierra (Darwin) x64

What did you do?

Given the template

package egtemplates

import (
    "fmt"
    "github.com/Sirupsen/logrus"
)

func before(vlog logrus.Logger, format string, args ...interface{}) {
    vlog.Errorf(fmt.Sprintf(format, args...))
}

func after(vlog logrus.Logger, format string, args ...interface{}) {
    vlog.Errorf(format, args...)
}

and the test file


package test

import (
    "fmt"

    "github.com/Sirupsen/logrus"
)

func articleCIPQ(vlog logrus.Logger) {
    vlog.Errorf(fmt.Sprintf("Table %s: %s", "something", "err"))
}

I executed eg -t egtemplates/logrus-errorf.go -v ./egtemplates/test/myfile.go.

What did you expect to see?

=== egtemplates/test/myfile.go (1 matches)
package test

import (
    "fmt"

    "github.com/Sirupsen/logrus"
)

func articleCIPQ(vlog logrus.Logger) {
    vlog.Errorf("Table %s: %s", "something", "err")
}

What did you see instead?

No substitutions, but no errors either.

@quentinmit quentinmit changed the title x/tools/cmd/eg does not appear to support ... argument expansions x/tools/cmd/eg: does not support variadic functions Oct 20, 2016

@quentinmit quentinmit added the NeedsFix label Oct 20, 2016

@quentinmit quentinmit added this to the Unreleased milestone Oct 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.