Testing problem (programming.dev)
submitted 2 weeks ago* (last edited 2 weeks ago) by to c/golang@lemmy.ml
 

I have a todo CLI app with the following structure

tree .
.
|-- cmd
|   `-- todo
|       |-- main.go
|       `-- main_test.go
|-- go.mod
|-- todo.go
|-- todo.json
`-- todo_test.go

In the main.go, I have a function called expand, it expand range string like in the cut command When I call the expand function from main_test.go, I get the following error

cmd/todo/main_test.go:141:12: undefined: expand
FAIL  PACKAGE_URI/todo/cmd/todo [build failed]
FAIL

I tried to change the function visibility, but this doesn't help either. I replicated the dir structure on a dummy project, and it did work!!

codeberg.org repo

edit: Add repo uri

you are viewing a single comment's thread
view the rest of the comments
[–] [S] 1 point 2 weeks ago

Again, thank you; this is very insightful. problem solved

  • source
  • parent