mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-11 05:57:05 +03:00
big merge
This commit is contained in:
34
components/spotify/cspot/cpp-reflection/main.go
Normal file
34
components/spotify/cspot/cpp-reflection/main.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/celer-network/pb3-gen-sol/generator"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c := NewCorntext()
|
||||
|
||||
data, err := ioutil.ReadAll(os.Stdin)
|
||||
if err != nil {
|
||||
generator.Error(err, "reading input")
|
||||
}
|
||||
|
||||
if err := proto.Unmarshal(data, c.Request); err != nil {
|
||||
generator.Error(err, "parsing input proto")
|
||||
}
|
||||
c.buildAllTypes()
|
||||
c.outputTypes()
|
||||
// Send back the results.
|
||||
data, err = proto.Marshal(c.Response)
|
||||
if err != nil {
|
||||
log.Fatal(err, "failed to marshal output proto")
|
||||
}
|
||||
_, err = os.Stdout.Write(data)
|
||||
if err != nil {
|
||||
log.Fatal(err, "failed to write output proto")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user