Skip to content

plugin: cannot load a plugin from a test where the plugin includes the tested package #17928

Closed
@crawshaw

Description

@crawshaw

On #17832 @wendigo notes that a go test for package p cannot load a plugin that imports package p without an error message about incorrect versions. This example is provided:

https://github.com/wendigo/go-plugin-33161

This is caused by the go tool rebuilding a package to include the test files, making the package in the test program incompatible with the equivalent package in the plugin.

I don't think this necessarily needs to work, it is entirely possible to do the plugin work from an external test from a package p_test. But maybe we could use a more helpful error message.

Any suggestions?

cc @ianlancetaylor

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions