SpongeBob is ready to write data to a file!

Report a typo

SpongeBob 🧽 has just finished learning how to write strings to files in Go! He started coding a program to write the string "I'm ready!" to the im_ready.txt file using the os.WriteFile() function.

When SpongeBob 🧽 was almost finished writing his program, Patrick⭐ pulled a prank on him and disordered all the code lines in his program!

Please help SpongeBob 🧽 arrange his code, so he can properly write the string to the file.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                }
              
                func main() {
              
                log.Fatal(err) // exit the program if we have an unexpected error
              
                if err := os.WriteFile("im_ready.txt", []byte(s), 0644); err != nil {
              
                s := "I'm ready!"
              
                }
              
___

Create a free account to access the full topic