Skip to content

Commit

Permalink
cleaning up realy app library fully
Browse files Browse the repository at this point in the history
starting on an automatic code sorter thing, got some ideas how to do it even better than previous times

discovered that nobody has actually done what i did before even, but i am sure there was something, but maybe not, maybe i ended up writing it because there wasn't

so, this collapses all of the code into main and test files, i will write the sorter/splitter and have it actually organise packages in a really consistent way
  • Loading branch information
mleku committed Nov 30, 2024
1 parent ff007ac commit 753cab3
Show file tree
Hide file tree
Showing 10 changed files with 642 additions and 652 deletions.
34 changes: 34 additions & 0 deletions cmd/sorted/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package main

import (
"fmt"
"go/ast"
"go/parser"
"go/token"
)

func main() {
src := `
package p
func f(x, y int) {
print(x + y)
}
`

fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "", src, 0)
if err != nil {
panic(err)
}

// Print identifiers in order
for n := range ast.Preorder(f) {
id, ok := n.(*ast.Ident)
if !ok {
continue
}
fmt.Println(id.Name)
}

}
21 changes: 21 additions & 0 deletions cmd/sorted/util.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package main

import (
"bytes"

"realy.lol/context"
"realy.lol/lol"
)

type (
B = []byte
S = string
E = error
N = int
Ctx = context.T
)

var (
log, chk, errorf = lol.Main.Log, lol.Main.Check, lol.Main.Errorf
equals = bytes.Equal
)
86 changes: 0 additions & 86 deletions realy/add-event.go

This file was deleted.

118 changes: 0 additions & 118 deletions realy/admin.go

This file was deleted.

59 changes: 0 additions & 59 deletions realy/handlerelayinfo.go

This file was deleted.

Loading

0 comments on commit 753cab3

Please sign in to comment.