global
statement detected PYL-W0603180 global gochan_bin
181 global gochan_exe
182 global migration_bin
183 global migration_exe184
185 if goos != "":
186 os.environ["GOOS"] = goos
179 global exe
180 global gochan_bin
181 global gochan_exe
182 global migration_bin183 global migration_exe
184
185 if goos != "":
178 global gcos_name # used for release, since macOS GOOS is "darwin"
179 global exe
180 global gochan_bin
181 global gochan_exe182 global migration_bin
183 global migration_exe
184
177 global gcos
178 global gcos_name # used for release, since macOS GOOS is "darwin"
179 global exe
180 global gochan_bin181 global gochan_exe
182 global migration_bin
183 global migration_exe
176 """ Sets GOOS-related variables to be used globally"""
177 global gcos
178 global gcos_name # used for release, since macOS GOOS is "darwin"
179 global exe180 global gochan_bin
181 global gochan_exe
182 global migration_bin
It is recommended not to use global
statement unless it is really necessary. Global variables are dangerous because they can be simultaneously accessed from multiple sections of a program. This frequently results in bugs. This also make code difficult to read, because they force you to search through multiple functions or even modules just to understand all the different locations where the global variable is used and modified. Read more about why it should be avoided here.