...

Source file src/google.golang.org/api/examples/tasks.go

Documentation: google.golang.org/api/examples

     1  // Copyright 2017 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"log"
     9  	"net/http"
    10  
    11  	tasks "google.golang.org/api/tasks/v1"
    12  )
    13  
    14  func init() {
    15  	registerDemo("tasks", tasks.TasksScope, tasksMain)
    16  }
    17  
    18  func tasksMain(client *http.Client, argv []string) {
    19  	taskapi, err := tasks.New(client)
    20  	if err != nil {
    21  		log.Fatalf("Unable to create Tasks service: %v", err)
    22  	}
    23  
    24  	task, err := taskapi.Tasks.Insert("@default", &tasks.Task{
    25  		Title: "finish this API code generator thing",
    26  		Notes: "ummmm",
    27  		Due:   "2011-10-15T12:00:00.000Z",
    28  	}).Do()
    29  	log.Printf("Got task, err: %#v, %v", task, err)
    30  }
    31  

View as plain text