always format files
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
		
							
								
								
									
										10
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								main.go
									
									
									
									
									
								
							| @@ -1,6 +1,8 @@ | |||||||
| package main | package main | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|  | 	"fmt" | ||||||
|  | 	"go/format" | ||||||
| 	"io" | 	"io" | ||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
| 	"log" | 	"log" | ||||||
| @@ -222,6 +224,14 @@ func main() { | |||||||
| 	// Generate the protobufs | 	// Generate the protobufs | ||||||
| 	g.GenerateAllFiles() | 	g.GenerateAllFiles() | ||||||
|  |  | ||||||
|  | 	for _, f := range g.Response.File { | ||||||
|  | 		fdata, err := format.Source([]byte(*f.Content)) | ||||||
|  | 		if err != nil { | ||||||
|  | 			g.Error(err, fmt.Sprintf("failed to format output: %s", *f.Content)) | ||||||
|  | 		} | ||||||
|  | 		*f.Content = string(fdata) | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	data, err = proto.Marshal(g.Response) | 	data, err = proto.Marshal(g.Response) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		g.Error(err, "failed to marshal output proto") | 		g.Error(err, "failed to marshal output proto") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user