Skip to content

Commit d28b204

Browse files
committed
Fixed unused import
1 parent 55ccee5 commit d28b204

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

api/cmd/loadtest/main.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package main
2+
3+
import (
4+
"bytes"
5+
"encoding/json"
6+
"fmt"
7+
"io/ioutil"
8+
"log"
9+
"net/http"
10+
11+
"github.com/palantir/stacktrace"
12+
)
13+
14+
func main() {
15+
client := http.Client{}
16+
for i := 0; i < 100; i++ {
17+
payload, err := json.Marshal(map[string]string{
18+
"content": fmt.Sprintf("testing http api sample: [%d]", i),
19+
"from": "+37259139660",
20+
"to": "+37253517181",
21+
})
22+
if err != nil {
23+
log.Fatal(stacktrace.Propagate(err, "cannot create json payload"))
24+
}
25+
response, err := client.Post("http://api.httpsms.com/messages/send", "application/json", bytes.NewBuffer(payload))
26+
if err != nil {
27+
log.Fatal(stacktrace.Propagate(err, "cannot perform http request"))
28+
}
29+
30+
if response.StatusCode != http.StatusOK {
31+
log.Fatal(stacktrace.NewError(fmt.Sprintf("status code [%d] is different from expected [%d]", response.StatusCode, http.StatusOK)))
32+
}
33+
34+
responsePayload, err := ioutil.ReadAll(response.Body)
35+
if err != nil {
36+
log.Fatal(stacktrace.NewError(fmt.Sprintf("cannot read response")))
37+
}
38+
39+
log.Println(string(responsePayload))
40+
}
41+
}

web/store/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import axios from '~/plugins/axios'
33
import { MessageThread } from '~/models/message-thread'
44
import { Message } from '~/models/message'
55
import { Heartbeat } from '~/models/heartbeat'
6-
import { compile } from 'vue-template-compiler'
76

87
type State = {
98
owner: string

0 commit comments

Comments
 (0)