Dnia 2021-02-20, o godz. 07:52:26
Peter Kleiweg napisał(a):
> you *can* tell go.mod that it should use local files instead of a repository.
[...]
> replace github.com/pebbe/package =>
> /home/peter/go/src/github.com/pebbe/package
In that sense, yes. You point to package directory and there are
Reading https://github.com/rogpeppe/gohack en trying some things, I found
that
you *can* tell go.mod that it should use local files instead of a
repository.
I have a test program outside my `~/go` tree with a `go.mod` like this:
```
module peter.nl/tester
go 1.16
replace github.com/pebbe/pac
Dnia 2021-02-20, o godz. 04:10:38
Peter Kleiweg napisał(a):
> Suppose I am writing a package that is in its own module, and I want
> to test it. Not with unit tests, but with a larger program that uses
> other non-standard packages as well.
[...]
> How do I get this right?
>
> Is there a way to
Suppose I am writing a package that is in its own module, and I want
to test it. Not with unit tests, but with a larger program that uses
other non-standard packages as well.
Before modules, I would develop the package in ~/go/src, write the
test program somewhere else, and import the package. Thi