How to use package from subdirectory?

I have a test app
-heyworld
heyworld.go
–stack
stack.go

How can I use the package stack which located in the subdirectory?
I use this way:
package main
import (
“fmt”
“./stack”
)
and it works when I run the app.
But When I build the Docker it gives me an error.

You’ve already asked this question here:

https://forum.golangbridge.org/t/how-to-build-the-docker-image/20372?u=lutzhorn

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.