def METHOD_NAME(go_tags, file):
  """Extract all yaml tags from given file and save them as list in dictionary."""
  with open(file, "r") as f:
    for line in f:
      if not 'yaml:' in line:
        continue
      line = line.strip()
      if line.startswith("//"):
        continue
      match = re.search(YAML_PATTERN, line)
      if not match:
        continue
      tag = match.group(1).split(",")[0]
      if not tag or tag == "-":
        continue
      go_tags.setdefault(file, []).append(tag)
      if not args.fields:
        continue
      name = line.split(" ", 1)[0]
      if name.lower() != tag.lower():
        print("WARNING: field name '{}' does not match yaml tag '{}'".format(name, tag))