File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -52,21 +52,24 @@ func init() {
5252
5353func getInputData (args []string ) (string , error ) {
5454 var deployedBytecode string
55+ var deployedBytecodeOrFile string
56+
5557 if len (args ) == 0 {
56- deployedBytecodeBytes , err := io .ReadAll (os .Stdin )
58+ deployedBytecodeOrFileBytes , err := io .ReadAll (os .Stdin )
5759 if err != nil {
5860 return "" , err
5961 }
60- deployedBytecode = string (deployedBytecodeBytes )
62+ deployedBytecodeOrFile = string (deployedBytecodeOrFileBytes )
6163 } else {
62- deployedBytecodeOrFile := args [0 ]
63- // Try to open the param as a file, otherwise treat it as bytecode
64- deployedBytecodeBytes , err := os .ReadFile (deployedBytecodeOrFile )
65- if err != nil {
66- deployedBytecode = deployedBytecodeOrFile
67- } else {
68- deployedBytecode = string (deployedBytecodeBytes )
69- }
64+ deployedBytecodeOrFile = args [0 ]
65+ }
66+ // Try to open the param as a file, otherwise treat it as bytecode
67+ deployedBytecodeOrFile = strings .TrimSpace (deployedBytecodeOrFile )
68+ deployedBytecodeBytes , err := os .ReadFile (deployedBytecodeOrFile )
69+ if err != nil {
70+ deployedBytecode = deployedBytecodeOrFile
71+ } else {
72+ deployedBytecode = string (deployedBytecodeBytes )
7073 }
7174
7275 return strings .TrimSpace (deployedBytecode ), nil
You can’t perform that action at this time.
0 commit comments