GAE Golang-如何正确安排任务队列到后端?

There is little information on how to schedule a Task Queue to a Backend in Google App Engine in Go. In TQ's Reference we can read:

// Additional HTTP headers to pass at the task's execution time.
// To schedule the task to be run with an alternate app version
// or backend, set the "Host" header.
Header http.Header

But there is no explanation on what to really set the "Host" to. In Backends' Overview we can similarly read:

Private backends can be accessed by application administrators, instances of the application, and by App Engine APIs and services (such as Task Queue tasks and Cron jobs) without any special configuration.

But again, no explanation is given.

I tried setting the "Host" value to the name of the backend, but the tasks are executed by the normal application.

t := taskqueue.NewPOSTTask("/", map[string][]string{"key": {key}})
t.Header.Add("Host", "backend")
if _, err := taskqueue.Add(c, t, ""); err != nil {
    return
}

What is the correct way to schedule a Backend call in GAE Go?

It's easiest to target a backend by using a named queue. e.g.:

_, err = taskqueue.Add(c, &taskqueue.Task{
    Path:    "/myProcessorPath",
    Payload: myPayload,
}, "myQueueName")

Your queue definition specifies the backend. e.g. for myQueueName, you might have a queue.yaml entry that looks like this:

- name: myQueueName
  target: myBackendName
  rate: 400/s
  max_concurrent_requests: 64
  bucket_size: 25
  retry_parameters:
    task_age_limit: 7d

Use the appengine.BackendHostname function to get the hostname for a backend. That should be usable as the Host header for a task.