k8sgpt-ai / k8sgpt-operator

Automatic SRE Superpowers within your Kubernetes cluster
https://k8sgpt.ai
Apache License 2.0
279 stars 76 forks source link

go fmt sinks_test and slack #378

Closed samrocketman closed 4 months ago

samrocketman commented 4 months ago

This kept showing up in my other pull request as an issue. I kept discarding it in that PR but here's one to fix it for good.

I ran

go fmt ./...
samrocketman commented 4 months ago

@JuHyung-Son said:

i don't know why but fmt is different with me. i got this after go fmt. tab size is different with you

It's not about tab size. Your go fmt is indenting with 4 spaces in these files. The rest of the project is using tab-character indenting i.e. \t

You might have some system-level setting for go fmt. I used a Docker container which doesn't have any additional go settings.

You could add go fmt settings into the project with project-specific fmt settings or update your local environment.

Options:

samrocketman commented 4 months ago

Another thought. Is it possible we're using different versions of go? I'm on the latest version. Which are you using?

JuHyung-Son commented 4 months ago

i use go1.21. you can see it in go.mod

im not sure it works in other version of go.

2024년 3월 16일 (토) 오전 10:39, Sam Gleske @.***>님이 작성:

Another thought. Is it possible we're using different versions of go? I'm on the latest version. Which are you using?

— Reply to this email directly, view it on GitHub https://github.com/k8sgpt-ai/k8sgpt-operator/pull/378#issuecomment-2001025976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZVAXTMVTGHVDEWM7XN2T3YYOPF5AVCNFSM6AAAAABEU64OEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBRGAZDKOJXGY . You are receiving this because you were mentioned.Message ID: @.***>

samrocketman commented 4 months ago

That's practically the same version as me go1.21.6. Not sure what is different.

JuHyung-Son commented 4 months ago

yeah.. i don`t know either.. then in other files, does your fmt all changes?? in other files, formatting should look like below.

new line character start below func's c

CleanShot 2024-03-16 at 23 02 24@2x

samrocketman commented 4 months ago

This PR is the result of running go fmt on all files. The command I posted in the PR description formats everything. It isn’t based on git diff.

JuHyung-Son commented 4 months ago

oh you are right. File changed confused me. it should be fmt