mirror of
https://github.com/rodneyosodo/memfault-go.git
synced 2026-06-23 04:00:08 +00:00
Format code with gofmt and gofumpt
This commit fixes the style issues introduced in 7392289 according to the output
from gofmt and gofumpt.
Details: https://deepsource.io/gh/0x6f736f646f/memfault-go/transform/13a35d98-5427-468d-aeec-d2abaad7845e/
This commit is contained in:
committed by
GitHub
parent
7392289c01
commit
6b963e212e
@@ -52,9 +52,7 @@ type SDK interface {
|
||||
|
||||
// Regenerate the Project Client Key
|
||||
RefreshProjectClientKey(projectSlug string) (UserAPIKeyRes, error)
|
||||
|
||||
CreateCohort(project Project, cohort Cohort) (CreateCohortRes, error)
|
||||
|
||||
ListCohorts(project Project) (ListCohortRes, error)
|
||||
}
|
||||
|
||||
|
||||
+32
-32
@@ -1,44 +1,44 @@
|
||||
package memfault
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
username = os.Getenv("MEMFAULT_USERNAME")
|
||||
password = os.Getenv("MEMFAULT_PASSWORD")
|
||||
username = os.Getenv("MEMFAULT_USERNAME")
|
||||
password = os.Getenv("MEMFAULT_PASSWORD")
|
||||
)
|
||||
|
||||
func TestCreateProject(t *testing.T) {
|
||||
creds := Credentials{
|
||||
Email: username,
|
||||
Password: password,
|
||||
}
|
||||
d, _ := time.ParseDuration("30s")
|
||||
conf := Config{
|
||||
APIURL: "https://api.memfault.com",
|
||||
Credentials: creds,
|
||||
MaxIdleConns: 10,
|
||||
IdleConnTimeout: d,
|
||||
}
|
||||
memfault := NewSDK(conf)
|
||||
payload := Project{
|
||||
Name: "SmartSdinkamakeabc",
|
||||
Slug: "smartsdinkmskeabc",
|
||||
Os: "FreeRTOS",
|
||||
Platform: "nRF52",
|
||||
}
|
||||
response1, err := memfault.CreateProject(payload)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(response1.Data.APIKey)
|
||||
creds := Credentials{
|
||||
Email: username,
|
||||
Password: password,
|
||||
}
|
||||
d, _ := time.ParseDuration("30s")
|
||||
conf := Config{
|
||||
APIURL: "https://api.memfault.com",
|
||||
Credentials: creds,
|
||||
MaxIdleConns: 10,
|
||||
IdleConnTimeout: d,
|
||||
}
|
||||
memfault := NewSDK(conf)
|
||||
payload := Project{
|
||||
Name: "SmartSdinkamakeabc",
|
||||
Slug: "smartsdinkmskeabc",
|
||||
Os: "FreeRTOS",
|
||||
Platform: "nRF52",
|
||||
}
|
||||
response1, err := memfault.CreateProject(payload)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(response1.Data.APIKey)
|
||||
|
||||
assert.Equal(t, err, errors.New("A project named `SmartSdinkamakeabc` already exists"), fmt.Sprintf("expected error %s, got nil", err))
|
||||
assert.Equal(t, err, errors.New("A project named `SmartSdinkamakeabc` already exists"), fmt.Sprintf("expected error %s, got nil", err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user