@@ -170,8 +170,6 @@ func setupUI() {
170
170
171
171
func setupGrid () {
172
172
grid = ui .NewGrid ()
173
-
174
- // Define the rows and columns
175
173
grid .Set (
176
174
ui .NewRow (1.0 / 2 , // This row now takes half the height of the grid
177
175
ui .NewCol (1.0 / 2 , ui .NewRow (1.0 / 2 , cpu1Gauge ), ui .NewCol (1.0 , ui .NewRow (1.0 , cpu2Gauge ))),
@@ -211,8 +209,6 @@ func switchGridLayout() {
211
209
ui .NewCol (2.0 / 6 , NetworkInfo ),
212
210
),
213
211
)
214
-
215
- // Set the new grid's dimensions to match the terminal size
216
212
termWidth , termHeight := ui .TerminalDimensions ()
217
213
newGrid .SetRect (0 , 0 , termWidth , termHeight )
218
214
grid = newGrid
@@ -237,7 +233,6 @@ func switchGridLayout() {
237
233
ui .NewCol (1.0 , memoryGauge ),
238
234
),
239
235
)
240
- // Set the new grid's dimensions to match the terminal size
241
236
termWidth , termHeight := ui .TerminalDimensions ()
242
237
newGrid .SetRect (0 , 0 , termWidth , termHeight )
243
238
grid = newGrid
@@ -250,16 +245,12 @@ func StderrToLogfile(logfile *os.File) {
250
245
syscall .Dup2 (int (logfile .Fd ()), 2 )
251
246
}
252
247
253
- func main () {
248
+ // goasitop main function
254
249
255
- if os .Geteuid () != 0 && len (os .Args ) > 1 && os .Args [1 ] != "--test" {
256
- fmt .Println ("Welcome to goasitop! Please try again and run goasitop with sudo privileges!" )
257
- fmt .Println ("Usage: sudo goasitop" )
258
- os .Exit (1 )
259
- }
250
+ func main () {
260
251
261
252
// get version from git
262
- version := "v0.1.0 "
253
+ version := "v0.1.1 "
263
254
if len (os .Args ) > 1 && os .Args [1 ] == "--version" {
264
255
fmt .Println ("goasitop version:" , version )
265
256
os .Exit (0 )
@@ -271,6 +262,12 @@ func main() {
271
262
os .Exit (0 )
272
263
}
273
264
265
+ if os .Geteuid () != 0 {
266
+ fmt .Println ("Welcome to goasitop! Please try again and run goasitop with sudo privileges!" )
267
+ fmt .Println ("Usage: sudo goasitop" )
268
+ os .Exit (1 )
269
+ }
270
+
274
271
logfile , err := setupLogfile ()
275
272
if err != nil {
276
273
stderrLogger .Fatalf ("failed to setup log file: %v" , err )
0 commit comments