github.com/likebike/go--@v0.0.0-20190911215757-0bd925d16e96/README.md (about)

     1  # go--
     2  It's Go, but *everything* is exported (like Python).
     3  
     4  This was a fun experimental fork of [Go](https://golang.org/), which I found to be extremely productive and user-friendly.  I finally decided to discontinue the experiment because `go vet` no longer worked and I didn't want to spend the time to fix it.  Also, I found an alternative workaround to solve the original problem that led me to create this fork in the first place.
     5  
     6  Here is an example of the augmented abilities of go-- :
     7  
     8  ```
     9  #!go/bin/go run
    10  //^^^^^^^^^^^^^ "shebang" support enables you to run Go programs as scripts.
    11  //              I usually like to say something like "#!/usr/bin/env go run",
    12  //              but on Linux a shebang command can only have ONE argument, so
    13  //              the kernel tries to run "go run" as a command, which fails.
    14  //              (BSD and MacOSX don't have this problem.)
    15  //              We *could* create a "go run" binary as part of Go-- to enable this
    16  //              in a cross-platform sort of way, but for now I just use this
    17  //              relative path.  You'll need to run from this directory.
    18  
    19  package main
    20  
    21  import (
    22      "fmt"
    23      "net/http"
    24      "encoding/json"
    25      "os"             // Unused imports now generate Warnings instead of Errors.
    26  )
    27  
    28  type T1 struct { n1,n2 int }
    29  
    30  func                       // I'm not saying that this is actually a good way to style your function definitions...
    31  (t T1)                     // I'm only saying that you should be allowed to do it if you want to.
    32  crazy_func_style
    33  (in1,in2 int)
    34  (out1,out2 int)
    35  {
    36      return 3,4
    37  }
    38  
    39  func main() {
    40      fmt.Println("\nWelcome to Go--.  Don't worry about those warnings that you see above -- they are a *feature*, not a bug!")
    41      fmt.Println("Go-- gives you some extra abilities, compared to normal Go:\n")
    42  
    43      unused:=5
    44      fmt.Println("    * Unused variables and imports now generate Warnings (like you see above) instead of Errors.\n")
    45  
    46      http.Header{}.clone(); _=http.response{}.status; http.htmlEscape("We can access <em>everything</em>!")
    47      fmt.Println("    * You can access unexported symbols.\n")
    48  
    49      var a,b T1; a.n1,a.n2=8,9
    50      bs,err:=json.Marshal(a); if err!=nil { panic(err) }
    51      err=json.Unmarshal(bs, &b); if err!=nil { panic(err) }
    52      if b.n1!=8 || b.n2!=9 { panic("json was unable to read/set unexported field!") }
    53      fmt.Println("    * encoding/json can un/marshal unexported fields.\n")
    54  
    55      if 0>1 { }  // Comments here are fine too.
    56      else { fmt.Println("    * More flexible whitespace in 'if' statements; `if cond {...} \\n else {...}` is now a valid syntax.\n") }
    57  
    58      three,four:=a.crazy_func_style(1,2); if three!=3 || four!=4 { panic("Incorrect crazy_func_style outputs!") }
    59      fmt.Println("    * More flexible whitespace in function definitions.\n")
    60  
    61      fmt.Println("    * You can use a 'shebang' line (#!...) to run your Go-- programs as scripts.\n")
    62  
    63      fmt.Println("Remember: with great power comes great responsiblity.  Have fun!\n")
    64  }
    65  
    66  ```
    67