如何在golang中获取<ul>的表单值?

In my use case I am using tag tag-it to get tags from user. I am getting the tags input in html <ul> form. I am using golang in server side.

html:

   <form class="comment-form" action="/add/" method="POST" enctype="multipart/form-data">
    <div class="form-input">
      <label for="tags_label">Tags</label>
      <ul id="tags">
        <script type="text/javascript">
          $("#myTags").tagit();
          var tagsArray = ["C", "C++", "Go", "Ruby"];
          $("#tags").tagit({
              itemName: "teamId",
              fieldName: "teamName",
              availableTags: tagsArray,
              allowSpaces:true,
              caseSensitive:false,
              removeConfirmation:true,
              placeholderText:"Tags",
              tagLimit: 5,
              allowDuplicates: false,
              singleFieldDelimiter: ',',
              onlyAvailableTags: false
          });
        </script>
      </ul>
    </div>
   </form>

and in server end I am trying to get the value like below similar to other fields in the form,

tags            := r.FormValue("tags")
log.Printf("Tags : ", tags)

But it is not working. Could someone help me with this?

EDIT: When I inspect the element this is what I see,

<div class="form-input">
    <label for="tags_label">Tags</label>
    <ul id="tags" class="tagit ui-widget ui-widget-content ui-corner-all">
        <script type="text/javascript">
            $("#myTags").tagit();
            var tagsArray = ["C", "C++", "Go", "Ruby"];
            $("#tags").tagit({
                    itemName: "teamId",
                    fieldName: "teamName",
                    availableTags: tagsArray,
                    allowSpaces:true,
                    caseSensitive:false,
                    removeConfirmation:true,
                    placeholderText:"Tags",
                    tagLimit: 5,
                    allowDuplicates: false,
                    singleFieldDelimiter: ',',
                    onlyAvailableTags: false
            });
        </script><li class="tagit-new"><input type="text" class="ui-widget-content ui-autocomplete-input" placeholder="Tags" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true"></li>
    </ul>                                            
</div>

Found the problem: you expected a single field but you didn't specify it in the options of tag-it. Use it as following (added some comments for clarity):

<script type="text/javascript">
    $("#myTags").tagit();
    var tagsArray = ["C", "C++", "Go", "Ruby"];
    $("#tags").tagit({
        fieldName: "teamName", // The name of the hidden input field
        availableTags: tagsArray,
        allowSpaces:true,
        caseSensitive:false,
        removeConfirmation:true,
        placeholderText:"Tags",
        tagLimit: 5,
        allowDuplicates: false,
        singleField: true, // Use a hidden input element with the fieldName name
        singleFieldDelimiter: ',', // Optional, default value is same.
        onlyAvailableTags: false
    });
</script>

During runtime (and entering tags) a hidden <input> will be used, with the tag that you specified in the tag-it options.

<input type="hidden" style="display:none;" value="Go,another value,C" name="teamName">

In Go, handle it as following (you missed the %s in Printf):

tags := r.FormValue("teamName")
log.Printf("Tags: %s", tags)

You can then split the tags with strings.Split.