-5

I am trying to learn Go and write my first test. I would like to figure out how to implement a faker to test CRUD on terraform.

I've figured out how to import faker and created the variables to use.

I tried to fmt.Println to see if it generates, but where do I see the Println if it's a test. It does not print when I do go test.

func testCheckTritonUserDelete(s *terraform.State) error {
    fmt.Println("INside testCheckTritonUserDelete")
    fmt.Println(fake.UserName())
    return nil

// this is the function in which I want to Println

NoSQLKnowHow
  • 4,449
  • 23
  • 35
epoX
  • 1
  • 2
    Go suppresses the stdout of passing tests, otherwise a passing run would be incredibly noisy. Use `-v` to see the full output. Or just look at `go help test` and `go help testflag`. – Adrian Jun 18 '19 at 18:00

1 Answers1

1

A test will say 'ok' if it has passed. A failing test will show the output. A quick way of making that happen is to add t.Fail() at the end of your Go test.

CorlinP
  • 169
  • 1
  • 2
  • 15
  • my test passes and says OK however I dont know where to see the PrintLn to see if its generating a username – epoX Jun 18 '19 at 18:22