What should I do if the newline character of Visual Studio Code under windows is inconsistent with that of GoLand under ubuntu?

colleagues developed under windows, I developed under ubuntu, I only changed a small part of a file, using git diff to view, the whole file has been modified by me, after comparison found to be the reason for different line breaks, how happy collaborative development?

Jan.16,2022

this specific reason may be complicated. After all, the problems caused by IDE and operating system are more complicated:

  • first confirm which newline character shall prevail, such as \ n , \ r\ n
PS: sometimes encounters the problem that a Tab symbol represents two or four spaces
  • IDE related settings, more tedious
according to personal development experience, cross-platform VSCode collaborative development does not have this problem. Goland has been used for a period of time. After having similar format problems, plus charging and memory consumption, it has been abandoned
.
  • in addition, individuals have also encountered gofmt , goreturn , goimport and other formatting tools
Menu