api: run go fmt

This commit is contained in:
Adhityaa Chandrasekar 2019-02-04 18:10:59 -05:00
parent 1aea90cb07
commit a4fbf67d73
5 changed files with 11 additions and 11 deletions

View File

@ -1,8 +1,8 @@
package main package main
import ( import (
"net/http"
"encoding/json" "encoding/json"
"net/http"
"time" "time"
) )
@ -16,8 +16,8 @@ func domainExportBeginError(email string, toName string, domain string, err erro
func domainExportBegin(email string, toName string, domain string) { func domainExportBegin(email string, toName string, domain string) {
type dataExport struct { type dataExport struct {
Version int `json:"version"` Version int `json:"version"`
Comments []comment `json:"comments"` Comments []comment `json:"comments"`
Commenters []commenter `json:"commenters"` Commenters []commenter `json:"commenters"`
} }
@ -114,7 +114,7 @@ func domainExportBegin(email string, toName string, domain string) {
func domainExportBeginHandler(w http.ResponseWriter, r *http.Request) { func domainExportBeginHandler(w http.ResponseWriter, r *http.Request) {
type request struct { type request struct {
OwnerToken *string `json:"ownerToken"` OwnerToken *string `json:"ownerToken"`
Domain *string `json:"domain"` Domain *string `json:"domain"`
} }
var x request var x request
@ -145,7 +145,7 @@ func domainExportBeginHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
go domainExportBegin(o.Email, o.Name, *x.Domain); go domainExportBegin(o.Email, o.Name, *x.Domain)
bodyMarshal(w, response{"success": true}) bodyMarshal(w, response{"success": true})
} }

View File

@ -1,8 +1,8 @@
package main package main
import ( import (
"net/http"
"fmt" "fmt"
"net/http"
"time" "time"
) )

View File

@ -14,7 +14,7 @@ func githubGetPrimaryEmail(accessToken string) (string, error) {
contents, err := ioutil.ReadAll(resp.Body) contents, err := ioutil.ReadAll(resp.Body)
if err != nil { if err != nil {
return "", errorCannotReadResponse return "", errorCannotReadResponse
} }
user := []map[string]interface{}{} user := []map[string]interface{}{}
@ -24,7 +24,7 @@ func githubGetPrimaryEmail(accessToken string) (string, error) {
} }
nonPrimaryEmail := "" nonPrimaryEmail := ""
for _, email := range(user) { for _, email := range user {
nonPrimaryEmail = email["email"].(string) nonPrimaryEmail = email["email"].(string)
if email["primary"].(bool) { if email["primary"].(bool) {
return email["email"].(string), nil return email["email"].(string), nil

View File

@ -7,8 +7,8 @@ import (
) )
type domainExportPlugs struct { type domainExportPlugs struct {
Origin string Origin string
Domain string Domain string
ExportHex string ExportHex string
} }

View File

@ -7,7 +7,7 @@ import (
) )
type domainExportErrorPlugs struct { type domainExportErrorPlugs struct {
Origin string Origin string
Domain string Domain string
} }