POST文件和嵌套参数golang

I'm already posting a file and some params, but now I need to send nested params with a struct and I don't know where to use that (I'm new in Go).

This is what I have: https://play.golang.org/p/L4qx6AZhUO

Now, I'm creating this structs:

type S3 struct {
    Accesskeyid     string
    Secretaccesskey string
    Bucket          string
}

type Test struct {
    Outputformat string
    Wait         string
    Output       S3
    File         []byte
}

And I would like to send the Test struct WITH the file. Any ideas?

Thanks!

Okay, So given what you've told me and what little information I have with your example, I might do something like this.

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

type S3 struct {
    Accesskeyid     string
    Secretaccesskey string
    Bucket          string
}

type Test struct {
    Outputformat string
    Wait         string
    Output       S3
    File         []byte
}

func main() {
    myStrut := Test{
        Outputformat: "Json",
        Wait:         "Some Time",
        Output: S3{
            Accesskeyid:     "my id",
            Secretaccesskey: "secret id",
            Bucket:          "east",
        },
        File: []byte(`some bytes`),
    }
    jsonValue, err := json.Marshal(myStrut)
    if err != nil {
        panic(err)
    }
    fmt.Printf("Test showing that data was marshalled
 %q
", jsonValue)
    resp, err := http.Post("some url", "application/json", bytes.NewBuffer(jsonValue))
    if err != nil {
        panic(err)
    }
    fmt.Println(resp.Status)

}

Now from what i gleamed in the comments you might be also having trouble opening the file as a byte array to assign to your struct. Here's an example you can use you help you open the file as a byte array so that you can assign those bytes to your struct.

package main

import (
    "fmt"
    "io/ioutil"
)

func main() {

    //An example of how to open a file and turn it into bytes for your struct
    byteArray, err := ioutil.ReadFile("input.txt")
    if err != nil {
        panic(err)
    }
    fmt.Println(byteArray)

}