Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: web/inc/rpcexplorer/test/gen.go

Issue 1960443004: Add rpcexplorer to webapp hierarchy. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-web
Patch Set: Updated license, clarified instructions. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file.
4
1 package main 5 package main
2 6
3 // This file generates descriptor.html. Run itself: 7 // This file generates descriptor.html. Run itself:
4 //go:generate go run gen.go 8 //go:generate go run gen.go
5 9
6 import ( 10 import (
7 "fmt" 11 "fmt"
8 "io/ioutil" 12 "io/ioutil"
9 "os" 13 "os"
10 "os/exec" 14 "os/exec"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 desc := &descriptor.FileDescriptorSet{} 46 desc := &descriptor.FileDescriptorSet{}
43 if err := proto.Unmarshal(descBytes, desc); err != nil { 47 if err := proto.Unmarshal(descBytes, desc); err != nil {
44 return fmt.Errorf("could not read descriptor file: %s", err) 48 return fmt.Errorf("could not read descriptor file: %s", err)
45 } 49 }
46 50
47 out, err := os.Create("descriptor.html") 51 out, err := os.Create("descriptor.html")
48 if err != nil { 52 if err != nil {
49 return err 53 return err
50 } 54 }
51 _, err = fmt.Fprint(out, `<!-- 55 _, err = fmt.Fprint(out, `<!--
52 Copyright 2016 The LUCI Authors. All rights reserved. 56 Copyright 2016 The Chromium Authors. All rights reserved.
53 Use of this source code is governed under the Apache License, Version 2.0 57 Use of this source code is governed by a BSD-style license that can be
54 that can be found in the LICENSE file. 58 found in the LICENSE file.
55 --> 59 -->
56 60
57 <!-- This file is generated by gen.go --> 61 <!-- This file is generated by gen.go -->
58 62
59 <script> 63 <script>
60 var testDescriptor = `) 64 var testDescriptor = `)
61 if err != nil { 65 if err != nil {
62 return err 66 return err
63 } 67 }
64 68
65 m := jsonpb.Marshaler{} 69 m := jsonpb.Marshaler{}
66 m.Indent = " " 70 m.Indent = " "
67 if err := m.Marshal(out, desc); err != nil { 71 if err := m.Marshal(out, desc); err != nil {
68 return err 72 return err
69 } 73 }
70 74
71 _, err = fmt.Fprintln(out, ";\n</script>") 75 _, err = fmt.Fprintln(out, ";\n</script>")
72 return err 76 return err
73 } 77 }
74 78
75 func main() { 79 func main() {
76 if err := run(); err != nil { 80 if err := run(); err != nil {
77 fmt.Fprintln(os.Stderr, err) 81 fmt.Fprintln(os.Stderr, err)
78 os.Exit(1) 82 os.Exit(1)
79 } 83 }
80 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698