Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang file naming structure #159

Open
4 tasks done
smnzlnsk opened this issue Dec 20, 2023 · 4 comments
Open
4 tasks done

Golang file naming structure #159

smnzlnsk opened this issue Dec 20, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@smnzlnsk
Copy link
Collaborator

smnzlnsk commented Dec 20, 2023

Short

Establish a file naming convention for golang files

Proposal

Currently the node-net-manager files do not follow a comprehensive file naming structure, which is desirable in any case.

As for golang, there is no documented styleguide for file naming, however general consensus seems to be all lower case, with snake case, where needed, while avoiding snake case suffixes like <file>_arm.go or <file>_linux.go, just like _test.go for tests. (see golang/go#36060)

My proposal is scanning the node-net-manager files and renaming long files to shorter ones where possible, while keeping the filenames as descriptive as possible. Generally a go-esque structure could be the following:

node-net-manager/
├─ environment/
├─ proxy/
│ ├─ tunnel.go
│ ├─ tunnel_test.go
│ ├─ cache.go
├─ mqtt/
│ ├─ tablequery.go
│ ├─ handlers.go
│ ├─ client.go
│ ├─ updates.go
├─ go.mod
├─ go.sum
├─ netmanager.go

Ratio

Better structure and a agreed upon file naming standard for this project

Impact

only file names in node-net-manager

Development time

1 hour

Status

looking for feedback

Checklist

  • Discussed
  • Documented
  • Implemented
  • Tested
@smnzlnsk smnzlnsk added enhancement New feature or request good first issue Good for newcomers labels Dec 20, 2023
@smnzlnsk
Copy link
Collaborator Author

smnzlnsk commented Apr 3, 2024

Bump @giobart @nitindermohan any opinions?

@giobart
Copy link
Contributor

giobart commented Apr 3, 2024

Yes this file names are good to me, just consider that the build script for github workflows needs to be changed as well.

@nitindermohan
Copy link
Contributor

I do agree with Giovanni. I have no particular critique on the file names proposed. Go ahead from my end!

@smnzlnsk
Copy link
Collaborator Author

integrated into #166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants