You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: main_test.go
    path of file: ./repos/golang-samples/eventarc/pubsub
    
    the code of the file until where you have to start completion: // Copyright 2019 Google LLC
//
// Licensed under the Apache License
    
func TestHelloPubSubCloudEvent(t *testing.T) {
	tests := []struct {
		data string
		want string
		id   string
	}{
		{want: "Hello, World! ID: \n", id: ""},
		{want: "Hello, World! ID: 12345\n", id: "12345"},
		{data: "Go", want: "Hello, Go! ID: \n"},
		{data: "Go", want: "Hello, Go! ID: 1234\n", id: "1234"},
	}
	log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))
	for _, test := range tests {
		r, w, _ := os.Pipe()
		log.SetOutput(w)
		defer log.SetOutput(os.Stderr)

		payload := strings.NewReader("{}")
		if test.data != "" {
			encoded := base64.StdEncoding.EncodeToString([]byte(test.data))
			jsonStr := fmt.Sprintf(`{"message":{"data":"%s","id":"%s"}}`, encoded, test.id)
			payload = strings.NewReader(jsonStr)
		}

		req := httptest.NewRequest("POST", "/", payload)
		req.Header.Set("Ce-Id", test.id)
		rr := httptest.NewRecorder()
		HelloEventsPubSub(rr, req)

		w.Close()

		if code := rr.Result().StatusCode; code == http.StatusBadRequest {
			t.Errorf("HelloEventsPubSub(%q) invalid input, status code (%q)", test.data, code)
		}

		out, err := ioutil.ReadAll(r)
		if err != nil {
			t.Fatalf("ReadAll: %v", err)
		}
		if got := string(out); got != test.want {
			t.Errorf("HelloEventsPubSub(%q): got %q, want %q", test.data, got, test.want)
		}
	}
}