Skip to content

Commit

Permalink
build: Add cgo build tags to all relevant files
Browse files Browse the repository at this point in the history
Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Dec 13, 2024
1 parent 9134ba4 commit 50acad9
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/ceems_api_server/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package main

// We need to import each resource manager and updater package here.
Expand Down
3 changes: 3 additions & 0 deletions cmd/ceems_lb/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/mock_resource_manager/cmd/mock_ceems_server/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

// Boiler plate code to create a new instance of CEEMSServer entrypoint
package main

Expand Down
3 changes: 3 additions & 0 deletions examples/mock_updater/cmd/mock_ceems_server/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

// Boiler plate code to create a new instance of usageStatsServerApp entrypoint
package main

Expand Down
3 changes: 3 additions & 0 deletions pkg/api/cli/cli.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

// Package cli implements the CLI of the CEEMS API server app
package cli

Expand Down
3 changes: 3 additions & 0 deletions pkg/api/cli/cli_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package cli

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/db/db.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

// Package db creates DB tables, call resource manager interfaces and
// populates the DB with compute units
package db
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/db/db_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package db

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/db/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package db

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/db/helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package db

import (
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/helper/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ func TestNodelistParser(t *testing.T) {
}

func TestTimeToTimestamp(t *testing.T) {
expectedTimeStamp := 1136239445000
var expectedTimeStamp int64 = 1136239445000

timeFormat := base.DatetimeLayout + "-0700"
timeStamp := TimeToTimestamp(timeFormat, "2006-01-02T15:04:05-0700")
assert.Equal(t, int64(expectedTimeStamp), timeStamp)
assert.Equal(t, expectedTimeStamp, timeStamp)

// Check failure case
timeStamp = TimeToTimestamp(timeFormat, "2006-01-0215:04:05-0700")
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http/error.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package http

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http/error_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package http

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http/middleware.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package http

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http/middleware_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package http

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http/querier_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package http

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http/server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

// Package http implements the HTTP server handlers for different resource endpoints
package http

Expand Down
3 changes: 3 additions & 0 deletions pkg/api/http/server_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package http

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/cli/cli.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

// Package cli implements the CLI app of load balancer
package cli

Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/cli/cli_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package cli

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/frontend/frontend.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

// Package frontend implements the frontend server of the load balancer
package frontend

Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/frontend/frontend_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package frontend

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/frontend/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package frontend

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/frontend/helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package frontend

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/frontend/middleware.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package frontend

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/lb/frontend/middleware_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package frontend

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/sqlite3/sqlite3.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

/*
Package sqlite3 implements a connect hook around the sqlite3 driver so that the
underlying connection can be fetched from the driver for more advanced operations such
Expand Down
3 changes: 3 additions & 0 deletions pkg/sqlite3/sqlite3_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package sqlite3

import (
Expand Down

0 comments on commit 50acad9

Please sign in to comment.