-
Notifications
You must be signed in to change notification settings - Fork 174
/
file_create.go
44 lines (37 loc) · 965 Bytes
/
file_create.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package veneur
// Change to `package main` to be able to run this file with `go run file_create.go`
// import (
// "fmt"
// "os"
// "path/filepath"
// "github.com/sirupsen/logrus"
// "github.com/stripe/veneur/v14/ssf"
// )
// func check(err error) {
// if err != nil {
// logrus.WithError(err).Fatal("rip")
// }
// }
// func main() {
// span := &ssf.SSFSpan{
// TraceId: 1,
// Id: 1,
// StartTimestamp: 1,
// EndTimestamp: 10,
// Error: false,
// Service: "testService",
// Operation: "operationTest",
// Tags: map[string]string{"tag1": "value1"},
// }
// buf, _ := span.Marshal()
// fmt.Println(buf)
// pbFile := filepath.Join("fixtures", "protobuf", "regression.pb")
// fmt.Println(pbFile)
// file, err := os.Create(pbFile)
// defer file.Close()
// check(err)
// var n int
// n, err = file.Write(buf)
// check(err)
// fmt.Printf("n: %d buf: %d\n", n, len(buf))
// }