Sort the code

Report a typo

Suppose you want to create a file — new_file.txt using the os.Create() function from the os package.

Please place the steps below in the correct order to properly create new_file.txt; remember to add error handling and close the file at the end of the program!

Take notice that for this task, the package main statement has been omitted.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                import "os"
              
                func main() {
              
                } // main() closing bracket
              
                if err != nil {
              
                file.Close()
              
                } // error closing bracket
              
                file, err := os.Open("test.txt")
              
                println(err)
              
___

Create a free account to access the full topic