Skip to content

Replace print commands without final newline #6

@tehsphinx

Description

@tehsphinx

The commands print, fmt.Print, fmt.Printf and maybe others currently destroy the output of go test --json as they have no final newline.

We should report that to be fixed in go test but for the time being we will replace these commands in students solutions with println / fmt.Println.

My current suggestion would be to add some sed commands to the test runner before executing the tests. This could also be done using the AST library to manipulate the AST if someone wants to dig into that.

Here the replace table I'd recommend to avoid having to remove/add imports:

  • print -> println
  • fmt.Print -> fmt.Println
  • fmt.Printf(...) -> fmt.Println(fmt.Sprintf(...))

Metadata

Metadata

Assignees

No one assigned

    Labels

    x:action/fixFix an issuex:knowledge/elementaryLittle Exercism knowledge requiredx:module/test-runnerWork on Test Runnersx:size/mediumMedium amount of workx:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions