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

[Bug] generate golang code fron testcatse, code is error #442

Closed
yuluo-yx opened this issue May 19, 2024 · 5 comments
Closed

[Bug] generate golang code fron testcatse, code is error #442

yuluo-yx opened this issue May 19, 2024 · 5 comments
Assignees
Labels
bug Something isn't working legend The contributions before they become a committer

Comments

@yuluo-yx
Copy link
Collaborator

  1. test case

image

  1. code
package main

import (
	"io"
	"net/http"
)

func main() {
	body := bytes.NewBufferString("")

	req, err := http.NewRequest("GET," "http://127.0.0.1:81/check", body)
	if err != nil {
		panic(err)
	}

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}

	if resp.StatusCode != http.StatusOK {
		panic("status code is not 200")
	}

	data, err := io.ReadAll(resp.Body)
	println(string(data))
}
  1. error
NewRequest("GET," "htt
import (
	"io"
	"net/http"
)

func main() {
	body := bytes.NewBufferString("")

not import bytes pkg.

@yuluo-yx yuluo-yx added the bug Something isn't working label May 19, 2024
@wt-goodluck
Copy link
Contributor

/assign @wt-goodluck

@LinuxSuRen
Copy link
Owner

I found some issues related to the special characters.

image
image

I guess we can fix it by changing from text/template to html/template

@yuluo-yx
Copy link
Collaborator Author

I found some issues related to the special characters.

image image

I guess we can fix it by changing from text/template to html/template

cc @wt-goodluck

@wt-goodluck
Copy link
Contributor

ok,I'll take a look at it tonight

wt-goodluck added a commit to wt-goodluck/api-testing that referenced this issue May 27, 2024
@LinuxSuRen
Copy link
Owner

fixed by #457

@LinuxSuRen LinuxSuRen added the legend The contributions before they become a committer label Jun 11, 2024
LinuxSuRen pushed a commit that referenced this issue Jun 17, 2024
* chore(deps): update rabbitmq docker tag to v3.12.5

* Update app version [skip ci]

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-action update-app-version <githubaction@githubaction.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working legend The contributions before they become a committer
Projects
None yet
Development

No branches or pull requests

3 participants