Declaring the Student model

Report a typo

Bruno is currently working with a SQLite database that contains the students table with the following columns:

students
id INTEGER
first_name TEXT
last_name TEXT
gpa REAL

Your task is to help Bruno write the additional required code to declare the Student model for the already existing students table.

This problem uses the reflect package and the hidden function checkModels() to check if you correctly declared the Student model. Also, since you're declaring a model for an existing table, you should NOT include the gorm.Model field in the Student model.
Write a program in Go
package main

import (
"fmt"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"log"
"reflect"
"strings"
"unicode"
)

// Declare the `Student` model below:
type ? struct {
? ?
FirstName ?
? ?
GPA ?
}

// DO NOT delete or modify the code within the main() function!
func main() {
_ = fmt.Print; _ = log.Print; _ = gorm.Config{};_ = sqlite.Dialector{};
_ = reflect.Struct; _ = strings.ToLower;_ = unicode.IsUpper;

checkModels()
}
___

Create a free account to access the full topic