Error in LaTeX code for a Matrix

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
W(f_1,\dotsc,f_g) := \text{det} 
    \begin{pmatrix}
f_1         & f_2           & \dots & f_g           \\
f_1'        & f_2'          & \dots & f_g'          \\ % <---
.           & .             &       & .             \\
.           & .             &       & .             \\
.           & .             &       & .             \\
f_1^{(g-1)} & f_2^{(g-1)}   & \dots & f_g^{(g-1)}
    \end{pmatrix}
\end{equation}
or better
\begin{equation}
W(f_1,\dotsc,f_g) := \det
    \begin{pmatrix}
f_1         & f_2           & \dots     & f_g           \\
f_1'        & f_2'          & \dots     & f_g'          \\
\vdots      & \vdots        & \ddots    & \vdots        \\
f_1^{(g-1)} & f_2^{(g-1)}   & \dots     & f_g^{(g-1)}
    \end{pmatrix}
\end{equation}
\end{document}

enter image description here

Addendum: To some people prefer to use instead := different symbols for definition. Discussion and different symbols about this symbols you can find in How to typeset := correctly. For example \coloneqq from the package mathtools or \colonequals from the package colonequals, etc. Differences between are subtle, however for people with with a keen sense of aesthetics they are important. For comparison observe the case of use of \colonequals:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{equation}
W(f_1,\dotsc,f_g) \coloneqq \det\begin{pmatrix}
        f_1         & f_2           & \dots     & f_g           \\
        f_1'        & f_2'          & \dots     & f_g'          \\
        \vdots      & \vdots        & \ddots    & \vdots        \\
        f_1^{(g-1)} & f_2^{(g-1)}   & \dots     & f_g^{(g-1)}
                                \end{pmatrix}
\end{equation}
\end{document}

enter image description here

Further possibility is use the unicode-math with xelatex˙orlualatexengine. This fonts define\coloneq` which gives:

enter image description here

@Sebastiano, thank you for pointing me on this detail. Personally I very rare if ever use (due to my professional background) symbols for equal by definition :-)


Use f_1^{\prime} instead of f_1^'.

enter image description here

I suggest to use \ddots and \vdots.

\documentclass{standalone}
\usepackage{amsmath}

\begin{document}

\begin{equation}
W(f_1,\dots,f_g):= \det
                \begin{pmatrix}
                    f_1         & f_2           & \dots & f_g \\
                    f_1^{\prime}& f_2^{\prime}  & \dots & f_g^{\prime} \\
                    \vdots      & \vdots        & \ddots& \vdots \\
                    f_1^{(g-1)} & f_2^{(g-1)}   & \dots & f_g^{(g-1)}
                \end{pmatrix}
\end{equation}

\end{document}