code: func subresource(path string) string {
  	parts := strings.Split(path, "/")
  	if len(parts) <= 2 {
  		return ""
  	}
  	if len(parts) == 3 {
  		return parts[2]
  	}
  	// panic to alert on programming error
  	panic("failed to parse subresource; invalid path")
  }
docs: // subresource is a handy method to get subresource name. Valid inputs are:
  //     input                     output
  //     ""                        ""
  //     "/"                       ""
  //     "/{name}"                 ""
  //     "/{name}/scale"           "scale"
  //     "/{name}/scale/foo"       invalid input