Using dot import in test


(cinematik) #1

Whad does this import mean when we use point in imports?

import (
	"os"
	"testing"

	"." // what is this?
)

(Norbert Melzer) #2

It imports the package from the folder the test is in.

This is often easier than spelling it out, but importing is still necessary when one uses a _test package.

Also, IIRC exported items are imported unqualified and will be put directly in the test packages namespace.