Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golang strings.ReplaceAll is undefined #1861

Closed
mightyco opened this issue Jul 1, 2019 · 1 comment
Closed

golang strings.ReplaceAll is undefined #1861

mightyco opened this issue Jul 1, 2019 · 1 comment

Comments

@mightyco
Copy link

mightyco commented Jul 1, 2019

Example code:

package kata

import (
	"fmt"
	"strings"
)

func Catalog(s string, article string) string {
  fmt.Println(strings.ReplaceAll("oink oink oink", "oink", "moo"))
  return "hi"
}

Expected result: Test fails but prints "moo moo moo".

Actual result: BUILD fails with STDERR:

codewarrior/kata

./solution.go:10:15: undefined: strings.ReplaceAll

This works on play.golang.org (with the exception that the package/function is "main").

image

image

@kazk
Copy link
Member

kazk commented Jul 1, 2019

That's because Codewars uses Go 1.10 as it says next the language name. ReplaceAll was added in 1.12.

You can request a new version by opening an issue on https://github.com/Codewars/codewars-runner-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants